mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Refactor: vecTxIn -> vecOutPoints for CompactTallyItem (#1932)
This commit is contained in:
parent
2ea6f7d82e
commit
0bd8c8e43a
@ -1181,7 +1181,7 @@ bool CPrivateSendClient::MakeCollateralAmounts(const CompactTallyItem& tallyItem
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
// denominated input is always a single one, so we can check its amount directly and return early
|
||||
if(!fTryDenominated && tallyItem.vecTxIn.size() == 1 && CPrivateSend::IsDenominatedAmount(tallyItem.nAmount))
|
||||
if(!fTryDenominated && tallyItem.vecOutPoints.size() == 1 && CPrivateSend::IsDenominatedAmount(tallyItem.nAmount))
|
||||
return false;
|
||||
|
||||
CWalletTx wtx;
|
||||
@ -1208,8 +1208,8 @@ bool CPrivateSendClient::MakeCollateralAmounts(const CompactTallyItem& tallyItem
|
||||
coinControl.fAllowWatchOnly = false;
|
||||
// send change to the same address so that we were able create more denoms out of it later
|
||||
coinControl.destChange = tallyItem.txdest;
|
||||
for (const auto& txin : tallyItem.vecTxIn)
|
||||
coinControl.Select(txin.prevout);
|
||||
for (const auto& outpoint : tallyItem.vecOutPoints)
|
||||
coinControl.Select(outpoint);
|
||||
|
||||
bool fSuccess = pwalletMain->CreateTransaction(vecSend, wtx, reservekeyChange,
|
||||
nFeeRet, nChangePosRet, strFail, &coinControl, true, ONLY_NONDENOMINATED);
|
||||
@ -1344,8 +1344,8 @@ bool CPrivateSendClient::CreateDenominated(const CompactTallyItem& tallyItem, bo
|
||||
coinControl.fAllowWatchOnly = false;
|
||||
// send change to the same address so that we were able create more denoms out of it later
|
||||
coinControl.destChange = tallyItem.txdest;
|
||||
for (const auto& txin : tallyItem.vecTxIn)
|
||||
coinControl.Select(txin.prevout);
|
||||
for (const auto& outpoint : tallyItem.vecOutPoints)
|
||||
coinControl.Select(outpoint);
|
||||
|
||||
CWalletTx wtx;
|
||||
CAmount nFeeRet = 0;
|
||||
|
@ -3120,7 +3120,7 @@ bool CWallet::SelectCoinsGrouppedByAddresses(std::vector<CompactTallyItem>& vecT
|
||||
CompactTallyItem& item = mapTally[txdest];
|
||||
item.txdest = txdest;
|
||||
item.nAmount += wtx.tx->vout[i].nValue;
|
||||
item.vecTxIn.push_back(CTxIn(outpoint.hash, i));
|
||||
item.vecOutPoints.emplace_back(outpoint.hash, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ struct CompactTallyItem
|
||||
{
|
||||
CTxDestination txdest;
|
||||
CAmount nAmount;
|
||||
std::vector<CTxIn> vecTxIn;
|
||||
std::vector<COutPoint> vecOutPoints;
|
||||
CompactTallyItem()
|
||||
{
|
||||
nAmount = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user