mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +01:00
check collateral tx, find masternode before vote
This commit is contained in:
parent
43fd168aa1
commit
a0addf20a9
@ -106,7 +106,9 @@ Value mnbudget(const Array& params, bool fHelp)
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
CWalletTx wtx;
|
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
|
// make our change address
|
||||||
CReserveKey reservekey(pwalletMain);
|
CReserveKey reservekey(pwalletMain);
|
||||||
@ -297,6 +299,12 @@ Value mnbudget(const Array& params, bool fHelp)
|
|||||||
if(!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, keyMasternode, pubKeyMasternode))
|
if(!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, keyMasternode, pubKeyMasternode))
|
||||||
return "Error upon calling SetKey";
|
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);
|
CBudgetVote vote(activeMasternode.vin, hash, nVote);
|
||||||
if(!vote.Sign(keyMasternode, pubKeyMasternode)){
|
if(!vote.Sign(keyMasternode, pubKeyMasternode)){
|
||||||
return "Failure to sign.";
|
return "Failure to sign.";
|
||||||
@ -596,6 +604,12 @@ Value mnfinalbudget(const Array& params, bool fHelp)
|
|||||||
if(!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, keyMasternode, pubKeyMasternode))
|
if(!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, keyMasternode, pubKeyMasternode))
|
||||||
return "Error upon calling SetKey";
|
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);
|
CFinalizedBudgetVote vote(activeMasternode.vin, hash);
|
||||||
if(!vote.Sign(keyMasternode, pubKeyMasternode)){
|
if(!vote.Sign(keyMasternode, pubKeyMasternode)){
|
||||||
return "Failure to sign.";
|
return "Failure to sign.";
|
||||||
|
Loading…
Reference in New Issue
Block a user