Skip to content

Commit 6c23b08

Browse files
committed
CCoinsKeyHasher::operator() should return size_t
It currently returns uint64_t, which on older boost (at least 1.46) causes test failures on 32-bit systems. This problem was introduced in bc42503. Fixes #4634.
1 parent 8d0d512 commit 6c23b08

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/coins.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ class CCoinsKeyHasher
247247

248248
public:
249249
CCoinsKeyHasher();
250-
uint64_t operator()(const uint256& key) const {
250+
// This *must* return size_t. With Boost 1.46 on 32-bit systems the
251+
// unordered_map will behave unpredictably if the custom hasher returns a
252+
// uint64_t, resulting in failures when syncing the chain (#4634).
253+
size_t operator()(const uint256& key) const {
251254
return key.GetHash(salt);
252255
}
253256
};

0 commit comments

Comments
 (0)