Skip to content

Commit 22b0b4a

Browse files
committed
[Cleanup] fix warning in comparisons with nCoinbaseMaturity
1 parent 666081d commit 22b0b4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,7 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins
18591859

18601860
// If prev is coinbase, check that it's matured
18611861
if (coin.IsCoinBase() || coin.IsCoinStake()) {
1862-
if (nSpendHeight - coin.nHeight < consensus.nCoinbaseMaturity)
1862+
if ((signed long)nSpendHeight - coin.nHeight < consensus.nCoinbaseMaturity)
18631863
return state.Invalid(false, REJECT_INVALID, "bad-txns-premature-spend-of-coinbase-coinstake",
18641864
strprintf("tried to spend coinbase/coinstake at depth %d", nSpendHeight - coin.nHeight));
18651865
}

src/txmempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
517517
continue;
518518
const CCoins *coins = pcoins->AccessCoins(txin.prevout.hash);
519519
if (nCheckFrequency != 0) assert(coins);
520-
if (!coins || ((coins->IsCoinBase() || coins->IsCoinStake()) && ((signed long)nMemPoolHeight) - coins->nHeight < (unsigned)Params().GetConsensus().nCoinbaseMaturity)) {
520+
if (!coins || ((coins->IsCoinBase() || coins->IsCoinStake()) && ((signed long)nMemPoolHeight) - coins->nHeight < Params().GetConsensus().nCoinbaseMaturity)) {
521521
transactionsToRemove.push_back(tx);
522522
break;
523523
}

0 commit comments

Comments
 (0)