Skip to content

Commit b20ad0e

Browse files
committed
Merge bitcoin/bitcoin#22772: refactor: hasher cleanup (follow-up to 19935)
4c69571 doc: remove outdated comment (Martin Zumsande) 16652a9 refactor: Remove unused KeyIDHasher (Martin Zumsande) Pull request description: Small follow-ups to #19935: - Removal of unused `KeyIDHasher` class ([comment in 19935](bitcoin/bitcoin#19935 (comment))) - Removal of an outdated comment, which referred to an old problem with the no longer supported Boost 1.46 and `boost::unordered_map`, now replaced by `std::unordered_map`. ([comment in 19935](bitcoin/bitcoin#19935 (comment))) ACKs for top commit: Saviour1001: Tested ACK <code>[4c69571](https://github.com/bitcoin/bitcoin/commit/4c69571e6eeae2c03d59045ea102baa5fd1c3816)</code> Zero-1729: ACK 4c69571 theStack: ACK 4c69571 🆗 Tree-SHA512: 243fda2120bfac6c40a268ca2c0f34482ce27e71fbc50005c0d13c2ad5db9ee72a037f9937c37cc50ed0f9f6f11ee6afee4ac50e5031d6876ec942f41f38dadf
2 parents 61a843e + 4c69571 commit b20ad0e

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

src/util/hasher.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ class SaltedOutpointHasher
3333
SaltedOutpointHasher();
3434

3535
/**
36-
* This *must* return size_t. With Boost 1.46 on 32-bit systems the
37-
* unordered_map will behave unpredictably if the custom hasher returns a
38-
* uint64_t, resulting in failures when syncing the chain (#4634).
39-
*
4036
* Having the hash noexcept allows libstdc++'s unordered_map to recalculate
4137
* the hash during rehash, so it does not have to cache the value. This
4238
* reduces node's memory by sizeof(size_t). The required recalculation has

src/wallet/scriptpubkeyman.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,6 @@ class CKeyPool
148148
}
149149
};
150150

151-
class KeyIDHasher
152-
{
153-
public:
154-
KeyIDHasher() {}
155-
156-
size_t operator()(const CKeyID& id) const
157-
{
158-
return id.GetUint64(0);
159-
}
160-
};
161-
162151
/*
163152
* A class implementing ScriptPubKeyMan manages some (or all) scriptPubKeys used in a wallet.
164153
* It contains the scripts and keys related to the scriptPubKeys it manages.

0 commit comments

Comments
 (0)