lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.64k stars 2.07k forks source link

[feature]: periodically clean the network result #8988

Open yyforyongyu opened 1 month ago

yyforyongyu commented 1 month ago

We have this CleanStore method defined as, https://github.com/lightningnetwork/lnd/blob/75ec6da177d428ebf562557c1f0360a1d96dbfe7/routing/router.go#L130-L136

This is only called when the channel router starts, https://github.com/lightningnetwork/lnd/blob/75ec6da177d428ebf562557c1f0360a1d96dbfe7/routing/router.go#L355-L358

We could call it more often to save disk space. Or, build new methods to directly consult the channel commitment in htlcswitch on this particular HTLC, which removes the need to save the "network results".

ProofOfKeags commented 1 month ago

Is there a reason this needs to be GC'ed as opposed to just cleaned up when it's no longer needed?