Skip to content

Commit

Permalink
Merge PIVX-Project#1458: [Bug] Fix min depth requirement for stake in…
Browse files Browse the repository at this point in the history
…puts in AvailableCoins

f2d31e5 [Bug] Fix min depth requirement for stake inputs in AvailableCoins (random-zebra)

Pull request description:

  If `nDepth` is equal to `nStakeMinDepth - 1` then the coin is not skipped in `AvailableCoins` and gets included in the list of stakeable utxos.
  This utxo won't be able to stake though, as it will fail `ContextCheck` in `Stake()` (logging an error), thus it shouldn't have been included in the first place.

ACKs for top commit:
  furszy:
    ACK f2d31e5 .
  Fuzzbawls:
    ACK f2d31e5

Tree-SHA512: 1b75a555e9ad4d2526fdc49e9059baaed1c383b6abc121f9cd85c48f44f82b21e13e8ee66f6d535c078f226360f93fd12ebf1889124acb74c0e7fcc17464dad7
  • Loading branch information
random-zebra authored and akshaynexus committed Mar 30, 2020
1 parent ab62736 commit 6e87fa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Expand Up @@ -2264,7 +2264,7 @@ bool CWallet::AvailableCoins(
if (nDepth == 0 && !pcoin->InMempool()) continue;

// Check min depth requirement for stake inputs
if (nCoinType == STAKEABLE_COINS && nDepth < Params().GetConsensus().nStakeMinDepth - 1) continue;
if (nCoinType == STAKEABLE_COINS && nDepth < Params().GetConsensus().nStakeMinDepth) continue;

for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
bool found = false;
Expand Down

0 comments on commit 6e87fa8

Please sign in to comment.