Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
[Wallet] Fix zPIV spend when too much mints are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Warrows committed Oct 29, 2018
1 parent 36ff235 commit 12255f3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/wallet.cpp
Expand Up @@ -4761,8 +4761,18 @@ bool CWallet::CreateZerocoinSpendTransaction(CAmount nValue, int nSecurityLevel,
vSelectedMints.emplace_back(mint);
}
} else {
for (const CZerocoinMint& mint : vSelectedMints)
nValueSelected += ZerocoinDenominationToAmount(mint.GetDenomination());
unsigned int mintsCount = 0;
for (const CZerocoinMint& mint : vSelectedMints) {
if (nValueSelected < nValue) {
nValueSelected += ZerocoinDenominationToAmount(mint.GetDenomination());
mintsCount ++;
}
else
break;
}
if (mintsCount < vSelectedMints.size()) {
vSelectedMints.resize(mintsCount);
}
}

int nArchived = 0;
Expand Down

0 comments on commit 12255f3

Please sign in to comment.