htlcswitch+peer: remove fwd pkgs once before tick, bump timer to 1hr

This commit changes the logic when garbage collecting forwarding
packages such that they are removed once when the function is called,
and then again upon subsequent ticks. This allows us to bump the
peer timer to 1 hour to limit the number of db transactions happening
in lnd. The forwarding packages need to be removed initially as
otherwise a flappy node will never have them garbage collected.
This commit is contained in:
eugene
2020-08-19 11:09:48 -04:00
parent 62e19185f1
commit ea467783e9
2 changed files with 34 additions and 18 deletions

View File

@@ -588,7 +588,7 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint,
OnChannelFailure: onChannelFailure,
SyncStates: syncStates,
BatchTicker: ticker.New(50 * time.Millisecond),
FwdPkgGCTicker: ticker.New(time.Minute),
FwdPkgGCTicker: ticker.New(time.Hour),
PendingCommitTicker: ticker.New(time.Minute),
BatchSize: 10,
UnsafeReplay: p.cfg.UnsafeReplay,