diff --git a/src/masternodes/mn_rpc.cpp b/src/masternodes/mn_rpc.cpp index 949cdbff08..c79c270442 100644 --- a/src/masternodes/mn_rpc.cpp +++ b/src/masternodes/mn_rpc.cpp @@ -583,10 +583,12 @@ UniValue setgov(const JSONRPCRequest& request) { CCoinControl coinControl; // Set change to selected foundation address - CTxDestination dest; - ExtractDestination(*auths.cbegin(), dest); - if (IsValidDestination(dest)) { - coinControl.destChange = dest; + if (!auths.empty()) { + CTxDestination dest; + ExtractDestination(*auths.cbegin(), dest); + if (IsValidDestination(dest)) { + coinControl.destChange = dest; + } } fund(rawTx, pwallet, optAuthTx, &coinControl); @@ -673,10 +675,12 @@ UniValue unsetgov(const JSONRPCRequest& request) { CCoinControl coinControl; // Set change to selected foundation address - CTxDestination dest; - ExtractDestination(*auths.cbegin(), dest); - if (IsValidDestination(dest)) { - coinControl.destChange = dest; + if (!auths.empty()) { + CTxDestination dest; + ExtractDestination(*auths.cbegin(), dest); + if (IsValidDestination(dest)) { + coinControl.destChange = dest; + } } fund(rawTx, pwallet, optAuthTx, &coinControl); @@ -767,10 +771,12 @@ UniValue setgovheight(const JSONRPCRequest& request) { CCoinControl coinControl; // Set change to selected foundation address - CTxDestination dest; - ExtractDestination(*auths.cbegin(), dest); - if (IsValidDestination(dest)) { - coinControl.destChange = dest; + if (!auths.empty()) { + CTxDestination dest; + ExtractDestination(*auths.cbegin(), dest); + if (IsValidDestination(dest)) { + coinControl.destChange = dest; + } } fund(rawTx, pwallet, optAuthTx, &coinControl); diff --git a/test/functional/feature_on_chain_government_voting_scenarios.py b/test/functional/feature_on_chain_government_voting_scenarios.py index 87a491b11a..68f0358910 100755 --- a/test/functional/feature_on_chain_government_voting_scenarios.py +++ b/test/functional/feature_on_chain_government_voting_scenarios.py @@ -20,7 +20,7 @@ def set_test_params(self): self.num_nodes = 1 self.setup_clean_chain = True self.extra_args = [ - ['-jellyfish_regtest=1', '-dummypos=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101', '-simulatemainnet=1'], + ['-jellyfish_regtest=1', '-dummypos=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101', '-rpc-governance-accept-neutral=1', '-simulatemainnet=1'], ] def setup_masternodes(self, nMasternodes = 19):