From f5ed4e4520550d43e84aacc828fef24fbfda8c92 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Mon, 10 Feb 2025 23:17:15 +0000 Subject: [PATCH] chain: make some integer conversions explicit We have an unsigned constant which we're bit-inverting, or'ing into a signed constant, then assigning back to the signed constant. We should make it explicit wth is going on here. --- src/chain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chain.h b/src/chain.h index 119b3683a3..6e023158d1 100644 --- a/src/chain.h +++ b/src/chain.h @@ -469,7 +469,7 @@ public: bool RemoveDynaFedMaskOnSerialize(bool for_read) { if (for_read) { bool is_dyna = nVersion < 0; - nVersion = ~CBlockHeader::DYNAFED_HF_MASK & nVersion; + nVersion = (int32_t) (~CBlockHeader::DYNAFED_HF_MASK & (uint32_t)nVersion); return is_dyna; } else { return is_dynafed_block();