diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -209,7 +209,7 @@ bool PartiallyDownloadedBlock::IsTxAvailable(size_t index) const { assert(!header.IsNull()); assert(index < txns_available.size()); - return txns_available[index] ? true : false; + return txns_available[index] != nullptr; } ReadStatus PartiallyDownloadedBlock::FillBlock( diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -314,8 +314,8 @@ #ifdef ENABLE_WALLET isminetype mine = pwallet ? IsMine(*pwallet, dest) : ISMINE_NO; - ret.pushKV("ismine", (mine & ISMINE_SPENDABLE) ? true : false); - ret.pushKV("iswatchonly", (mine & ISMINE_WATCH_ONLY) ? true : false); + ret.pushKV("ismine", bool(mine & ISMINE_SPENDABLE)); + ret.pushKV("iswatchonly", bool(mine & ISMINE_WATCH_ONLY)); UniValue detail = boost::apply_visitor(DescribeAddressVisitor(pwallet), dest); ret.pushKVs(detail); diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -328,7 +328,7 @@ tx.vout[0].nValue -= LOWFEE; hash = tx.GetId(); // Only first tx spends coinbase. - bool spendsCoinbase = (i == 0) ? true : false; + bool spendsCoinbase = i == 0; // If we don't set the # of sig ops in the CTxMemPoolEntry, template // creation fails. g_mempool.addUnchecked(hash, entry.Fee(LOWFEE) @@ -348,7 +348,7 @@ tx.vout[0].nValue -= LOWFEE; hash = tx.GetId(); // Only first tx spends coinbase. - bool spendsCoinbase = (i == 0) ? true : false; + bool spendsCoinbase = i == 0; // If we do set the # of sig ops in the CTxMemPoolEntry, template // creation passes. g_mempool.addUnchecked(hash, entry.Fee(LOWFEE) @@ -378,7 +378,7 @@ tx.vout[0].nValue -= LOWFEE; hash = tx.GetId(); // Only first tx spends coinbase. - bool spendsCoinbase = (i == 0) ? true : false; + bool spendsCoinbase = i == 0; g_mempool.addUnchecked(hash, entry.Fee(LOWFEE) .Time(GetTime()) .SpendsCoinbase(spendsCoinbase) diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h --- a/src/test/test_bitcoin.h +++ b/src/test/test_bitcoin.h @@ -49,9 +49,6 @@ static inline bool InsecureRandBool() { return insecure_rand_ctx.randbool(); } -static inline std::vector InsecureRandBytes(size_t len) { - return insecure_rand_ctx.randbytes(len); -} /** * Basic testing setup.