Skip to content

Commit f5ed4e4

Browse files
committed
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.
1 parent 86d740b commit f5ed4e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/chain.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ class CDiskBlockIndex : public CBlockIndex
469469
bool RemoveDynaFedMaskOnSerialize(bool for_read) {
470470
if (for_read) {
471471
bool is_dyna = nVersion < 0;
472-
nVersion = ~CBlockHeader::DYNAFED_HF_MASK & nVersion;
472+
nVersion = (int32_t) (~CBlockHeader::DYNAFED_HF_MASK & (uint32_t)nVersion);
473473
return is_dyna;
474474
} else {
475475
return is_dynafed_block();

0 commit comments

Comments
 (0)