Skip to content

Commit

Permalink
CCoinsKeyHasher::operator() should return size_t
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
laanwj committed Aug 7, 2014
1 parent 8d0d512 commit 6c23b08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/coins.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ class CCoinsKeyHasher

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

0 comments on commit 6c23b08

Please sign in to comment.