Skip to content

Commit

Permalink
Comments on std hashmap bucket defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jan 13, 2025
1 parent f180653 commit e91990f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/bitcoin/network/async/desubscriber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class desubscriber final

// These are not thread safe.
bool stopped_{ false };

// TODO: optimize, default bucket count is around 8.
std::map<Key, handler> map_{};
};

Expand Down
2 changes: 2 additions & 0 deletions include/bitcoin/network/net/hosts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ class BCT_API hosts
// These are not thread safe.
buffer buffer_;
bool stopped_{ true };

// TODO: optimize, default bucket count is around 8.
std::unordered_set<config::authority> authorities_{};
};

Expand Down
1 change: 1 addition & 0 deletions include/bitcoin/network/p2p.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class BCT_API p2p
object_key keys_{};

// Guards loopback.
// TODO: optimize, default bucket count is around 8.
std::unordered_set<uint64_t> nonces_{};
};

Expand Down

0 comments on commit e91990f

Please sign in to comment.