mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Merge #19822: chain: Fix CChain comparison UB by removing it (it was unused)
df536883d2
chain: Remove UB CChain comparison (Carl Dong) Pull request description: Comparing two empty `CChain`s is currently undefined behaviour, and resulted in false assertion failures when comparing identical empty `CChain`s in local testing. Let's just remove this comparison operator since it doesn't seem to be used anywhere. ACKs for top commit: practicalswift: ACKdf536883d2
-- patch is guaranteed to be correct :) MarcoFalke: cr ACKdf536883d2
Tree-SHA512: db10bac364fc965b56abf7a5bac48018786b14806ffe107e3e8eb24d5004a29331f3387dfe3409a3452a6750d3329e3f354265d787ebb3abfccabe77b28a54d5
This commit is contained in:
commit
4326515f01
1 changed files with 0 additions and 6 deletions
|
@ -398,12 +398,6 @@ public:
|
|||
return vChain[nHeight];
|
||||
}
|
||||
|
||||
/** Compare two chains efficiently. */
|
||||
friend bool operator==(const CChain &a, const CChain &b) {
|
||||
return a.vChain.size() == b.vChain.size() &&
|
||||
a.vChain[a.vChain.size() - 1] == b.vChain[b.vChain.size() - 1];
|
||||
}
|
||||
|
||||
/** Efficiently check whether a block is present in this chain. */
|
||||
bool Contains(const CBlockIndex *pindex) const {
|
||||
return (*this)[pindex->nHeight] == pindex;
|
||||
|
|
Loading…
Add table
Reference in a new issue