mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-18 19:47:53 +02:00
Merge bitcoin/bitcoin#24146: Avoid integer sanitizer warnings in chain.o
fa832103aaAvoid 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: utACKfa832103aajonatack: ACKfa832103aaTree-SHA512: d32a06099c56eed9f69130a3209f989872acc593f849528acd7746ee6caa96688cc32de37e8e59ad5d25dcb8912e341f1a43e50642dadeff6ca7624d0873ad10
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user