diff --git a/src/rpcmasternode-budget.cpp b/src/rpcmasternode-budget.cpp index aeea7f4b7..c0963f648 100644 --- a/src/rpcmasternode-budget.cpp +++ b/src/rpcmasternode-budget.cpp @@ -106,7 +106,9 @@ Value mnbudget(const Array& params, bool fHelp) // } CWalletTx wtx; - pwalletMain->GetBudgetSystemCollateralTX(wtx, budgetProposalBroadcast.GetHash(), useIX); + if(!pwalletMain->GetBudgetSystemCollateralTX(wtx, budgetProposalBroadcast.GetHash(), useIX)){ + return "Error making collateral transaction for proposal. Please check your wallet balance and make sure your wallet is unlocked."; + } // make our change address CReserveKey reservekey(pwalletMain); @@ -297,6 +299,12 @@ Value mnbudget(const Array& params, bool fHelp) if(!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, keyMasternode, pubKeyMasternode)) return "Error upon calling SetKey"; + CMasternode* pmn = mnodeman.Find(activeMasternode.vin); + if(pmn == NULL) + { + return "Failure to find masternode in list : " + activeMasternode.vin.ToString(); + } + CBudgetVote vote(activeMasternode.vin, hash, nVote); if(!vote.Sign(keyMasternode, pubKeyMasternode)){ return "Failure to sign."; @@ -596,6 +604,12 @@ Value mnfinalbudget(const Array& params, bool fHelp) if(!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, keyMasternode, pubKeyMasternode)) return "Error upon calling SetKey"; + CMasternode* pmn = mnodeman.Find(activeMasternode.vin); + if(pmn == NULL) + { + return "Failure to find masternode in list : " + activeMasternode.vin.ToString(); + } + CFinalizedBudgetVote vote(activeMasternode.vin, hash); if(!vote.Sign(keyMasternode, pubKeyMasternode)){ return "Failure to sign.";