mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +01:00
Commit collateral transaction correctly for finalized budget
This commit is contained in:
parent
40a14cb802
commit
6fa0d23714
@ -2,6 +2,9 @@
|
|||||||
// Distributed under the MIT/X11 software license, see the accompanying
|
// Distributed under the MIT/X11 software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
#include "init.h"
|
||||||
|
|
||||||
#include "masternode-budget.h"
|
#include "masternode-budget.h"
|
||||||
#include "masternode.h"
|
#include "masternode.h"
|
||||||
#include "darksend.h"
|
#include "darksend.h"
|
||||||
@ -137,11 +140,19 @@ void CBudgetManager::SubmitFinalBudget()
|
|||||||
//create fee tx
|
//create fee tx
|
||||||
CTransaction tx;
|
CTransaction tx;
|
||||||
if(!mapCollateral.count(tempBudget.GetHash())){
|
if(!mapCollateral.count(tempBudget.GetHash())){
|
||||||
if(!pwalletMain->GetBudgetSystemCollateralTX(tx, tempBudget.GetHash(), true)){
|
CWalletTx wtx;
|
||||||
|
if(!pwalletMain->GetBudgetSystemCollateralTX(wtx, tempBudget.GetHash(), true)){
|
||||||
LogPrintf("SubmitFinalBudget - Can't make collateral transaction\n");
|
LogPrintf("SubmitFinalBudget - Can't make collateral transaction\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mapCollateral.insert(make_pair(tempBudget.GetHash(), tx));
|
|
||||||
|
// make our change address
|
||||||
|
CReserveKey reservekey(pwalletMain);
|
||||||
|
//send the tx to the network
|
||||||
|
pwalletMain->CommitTransaction(wtx, reservekey, "ix");
|
||||||
|
|
||||||
|
mapCollateral.insert(make_pair(tempBudget.GetHash(), (CTransaction)wtx));
|
||||||
|
tx = (CTransaction)wtx;
|
||||||
} else {
|
} else {
|
||||||
tx = mapCollateral[tempBudget.GetHash()];
|
tx = mapCollateral[tempBudget.GetHash()];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user