Lazy calculate vchKeyedNetGroup in CNode::GetKeyedNetGroup.
This is a (very small) performance improvement.
Fix mentioned by gmaxwell in #8086
bleh. There really is no reason to do this lazily. It should eagerly generate it at connection time, saving a hashing operation that it's going to perform anyways is not a good trade-off for having an extra heap allocation. Doubly so when the hash is changed to siphash.
Lazy calculate vchKeyedNetGroup in CNode::GetKeyedNetGroup.
364 | @@ -363,6 +365,8 @@ class CNode 365 | CBloomFilter* pfilter; 366 | int nRefCount; 367 | NodeId id; 368 | + 369 | + std::vector<unsigned char> vchKeyedNetGroup;
Use a uint256, or even a uint64_t.
uint64_t please. The probability that two distinct net-groups share a 64-bit hash is negligible, and if it ever happens its harmless (and would have no effect at all unless it's a collision with one of the four lowest ones that are in use).
Concept ACK. I think SHA256 is still overkill, but this is a clear improvement.
This should be closed, was merged via 8086->8173.