diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -126,8 +126,8 @@ // last block to prune is the lesser of (user-specified height, // MIN_BLOCKS_TO_KEEP from the tip) - unsigned int nLastBlockWeCanPrune = std::min( - (unsigned)nManualPruneHeight, chain_tip_height - MIN_BLOCKS_TO_KEEP); + unsigned int nLastBlockWeCanPrune{std::min( + (unsigned)nManualPruneHeight, chain_tip_height - MIN_BLOCKS_TO_KEEP)}; int count = 0; for (int fileNumber = 0; fileNumber < m_last_blockfile; fileNumber++) { if (m_blockfile_info[fileNumber].nSize == 0 || diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2216,7 +2216,7 @@ int64_t cacheSize = CoinsTip().DynamicMemoryUsage(); int64_t nTotalSpace = max_coins_cache_size_bytes + - std::max(max_mempool_size_bytes - nMempoolUsage, 0); + std::max(int64_t(max_mempool_size_bytes) - nMempoolUsage, 0); //! No need to periodic flush if at least this much space still available. static constexpr int64_t MAX_BLOCK_COINSDB_USAGE_BYTES = @@ -4347,8 +4347,8 @@ // blocks which are too close in height to the tip. Apply this test // regardless of whether pruning is enabled; it should generally be safe to // not process unrequested blocks. - bool fTooFarAhead = - (pindex->nHeight > int(m_chain.Height() + MIN_BLOCKS_TO_KEEP)); + bool fTooFarAhead{pindex->nHeight > + m_chain.Height() + int(MIN_BLOCKS_TO_KEEP)}; // TODO: Decouple this function from the block download logic by removing // fRequested @@ -5024,7 +5024,7 @@ try { // Locate a header. uint8_t buf[CMessageHeader::MESSAGE_START_SIZE]; - blkdat.FindByte(m_params.DiskMagic()[0]); + blkdat.FindByte(char(m_params.DiskMagic()[0])); nRewind = blkdat.GetPos() + 1; blkdat >> buf; if (memcmp(buf, m_params.DiskMagic().data(), diff --git a/test/sanitizer_suppressions/ubsan b/test/sanitizer_suppressions/ubsan --- a/test/sanitizer_suppressions/ubsan +++ b/test/sanitizer_suppressions/ubsan @@ -63,7 +63,6 @@ implicit-integer-sign-change:test/transaction_tests.cpp implicit-integer-sign-change:txmempool.cpp implicit-integer-sign-change:util/strencodings.* -implicit-integer-sign-change:validation.cpp implicit-integer-sign-change:zmq/zmqpublishnotifier.cpp implicit-signed-integer-truncation,implicit-integer-sign-change:chain.h implicit-signed-integer-truncation,implicit-integer-sign-change:test/skiplist_tests.cpp