chain: Remove UB CChain comparison

It was unused, and had UB
This commit is contained in:
Carl Dong 2020-08-27 12:46:22 -04:00
parent 93ab136a33
commit df536883d2
No known key found for this signature in database
GPG key ID: 0CC52153197991A5

View file

@ -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;