decred / dcrd

Decred daemon in Go (golang).
https://decred.org
ISC License
731 stars 289 forks source link

multi: Use new container/lru module. #3360

Closed davecgh closed 1 month ago

davecgh commented 1 month ago

~This requires #3359.~

This consists of a series of commits to update the code to make use of the new container/lru module as well as deprecate and remove the existing interface-based lru module.

In addition to being a bit more efficient, it also has the benefit of using the expiration functionality the new module provides to impose an expiration time of 15 minutes on the known inventory entries for peers. This allows the possibility of the cache shrinking over time in periods of low activity versus the current behavior where it will eventually reach the limit and stay there indefinitely.

Each commit is intended to be a self-contained and logically easy to follow change such that the code continues to compile and the tests continue to pass at each step.

See the description of each commit for further details.