diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-01-31 09:23:49 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-01-31 09:23:54 +0100 |
commit | b25a752dfdbb12fd579e1dbef2bb95096867046b (patch) | |
tree | b9d813b541a55ddb30b2a895eec113524052e107 /src | |
parent | 9237bdaac196951a437accaefa65638149b25978 (diff) | |
parent | fa832103aaa61e93b78ece9dd68c245a41afa6b6 (diff) |
Merge bitcoin/bitcoin#24146: Avoid integer sanitizer warnings in chain.o
fa832103aaa61e93b78ece9dd68c245a41afa6b6 Avoid integer sanitizer warnings in chain.o (MarcoFalke)
Pull request description:
The two changes make the code more self-documenting and also allow to remove 5 file-wide suppressions for the module
ACKs for top commit:
PastaPastaPasta:
utACK fa832103aaa61e93b78ece9dd68c245a41afa6b6
jonatack:
ACK fa832103aaa61e93b78ece9dd68c245a41afa6b6
Tree-SHA512: d32a06099c56eed9f69130a3209f989872acc593f849528acd7746ee6caa96688cc32de37e8e59ad5d25dcb8912e341f1a43e50642dadeff6ca7624d0873ad10
Diffstat (limited to 'src')
-rw-r--r-- | src/chain.cpp | 2 | ||||
-rw-r--r-- | src/chain.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/chain.cpp b/src/chain.cpp index e0c29372dd..b8158f7b0b 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -151,7 +151,7 @@ int64_t GetBlockProofEquivalentTime(const CBlockIndex& to, const CBlockIndex& fr if (r.bits() > 63) { return sign * std::numeric_limits<int64_t>::max(); } - return sign * r.GetLow64(); + return sign * int64_t(r.GetLow64()); } /** Find the last common ancestor two blocks have. diff --git a/src/chain.h b/src/chain.h index 8b03e66a96..24b5026aba 100644 --- a/src/chain.h +++ b/src/chain.h @@ -475,7 +475,7 @@ public: /** Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1. */ int Height() const { - return vChain.size() - 1; + return int(vChain.size()) - 1; } /** Set/initialize a chain with a given tip. */ |