Found while building on Debian 7
NOTE: There is one remaining warning I was not able to figure out:
test/util_tests.cpp:322:5: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Found while building on Debian 7
NOTE: There is one remaining warning I was not able to figure out:
test/util_tests.cpp:322:5: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
135 | @@ -136,7 +136,7 @@ extern bool fPruneMode; 136 | /** Number of MiB of block files that we're trying to stay below. */ 137 | extern uint64_t nPruneTarget; 138 | /** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned. */ 139 | -static const signed int MIN_BLOCKS_TO_KEEP = 288; 140 | +static const unsigned MIN_BLOCKS_TO_KEEP = 288;
Feels strange to not see the type in here, no?
We never use unsigned without type in the code anywhere else, let's just make this unsigned int.
I see 5 other cases in the code, but fine with me.
495 | @@ -496,7 +496,7 @@ void CTxMemPool::removeCoinbaseSpends(const CCoinsViewCache *pcoins, unsigned in 496 | continue; 497 | const CCoins *coins = pcoins->AccessCoins(txin.prevout.hash); 498 | if (fSanityCheck) assert(coins); 499 | - if (!coins || (coins->IsCoinBase() && nMemPoolHeight - coins->nHeight < COINBASE_MATURITY)) { 500 | + if (!coins || (coins->IsCoinBase() && ((signed long)nMemPoolHeight) - coins->nHeight < COINBASE_MATURITY)) {
coins->nHeight is an int, nMempoolHeight is an unsigned int. Any specific reason for introducing a signed long here?
COINBASE_MATURITY is a [signed] int, and we are subtracting.
Right.
Untested ACK, needs rebase.
Found while building on Debian 7
Rebased