Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: vecTxIn -> vecOutPoints for CompactTallyItem #1932

Merged
merged 1 commit into from
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/privatesend-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct CompactTallyItem
{
CTxDestination txdest;
CAmount nAmount;
std::vector<CTxIn> vecTxIn;
std::vector<COutPoint> vecOutPoints;
CompactTallyItem()
{
nAmount = 0;
Expand Down