From ed21e6897904b359bbb04bd6877151504b0ced93 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 15 Feb 2018 10:29:31 +0300 Subject: [PATCH] Refactor: vecTxIn -> vecOutPoints for CompactTallyItem (#1932) --- src/privatesend-client.cpp | 10 +++++----- src/wallet/wallet.cpp | 2 +- src/wallet/wallet.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/privatesend-client.cpp b/src/privatesend-client.cpp index 8b5b30f74db83..00cca6208dcf9 100644 --- a/src/privatesend-client.cpp +++ b/src/privatesend-client.cpp @@ -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; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 8bf6af7faf8b6..6be81de4ff96f 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3117,7 +3117,7 @@ bool CWallet::SelectCoinsGrouppedByAddresses(std::vector& 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); } } diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 57ede80f70abb..1f0fdaa417067 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -113,7 +113,7 @@ struct CompactTallyItem { CTxDestination txdest; CAmount nAmount; - std::vector vecTxIn; + std::vector vecOutPoints; CompactTallyItem() { nAmount = 0;