Refactor: vecTxIn -> vecOutPoints for CompactTallyItem (#1932)

This commit is contained in:
UdjinM6 2018-02-15 10:29:31 +03:00 committed by GitHub
parent 2ea6f7d82e
commit 0bd8c8e43a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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);
}
}

View File

@ -113,7 +113,7 @@ struct CompactTallyItem
{
CTxDestination txdest;
CAmount nAmount;
std::vector<CTxIn> vecTxIn;
std::vector<COutPoint> vecOutPoints;
CompactTallyItem()
{
nAmount = 0;