Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: optimize HasBlock check for recent blocks
When block is being spread through the network we can get a lot of invs with the same hash. Some more stale nodes may also announce previous or some earlier block. We can avoid full DB lookup for them and minimize inv handling time (timeouts in inv handler had happened in #2744). It doesn't affect tests, just makes node a little less likely to spend some considerable amount of time in the inv handler.
- Loading branch information