multi: introduce config-level DustThreshold for defining threshold

This commit is contained in:
eugene
2021-09-28 13:50:11 -04:00
parent 3897baff0a
commit 702b3a3258
6 changed files with 23 additions and 5 deletions

View File

@ -490,6 +490,9 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
s.htlcNotifier = htlcswitch.NewHtlcNotifier(time.Now)
thresholdSats := btcutil.Amount(cfg.DustThreshold)
thresholdMSats := lnwire.NewMSatFromSatoshis(thresholdSats)
s.htlcSwitch, err = htlcswitch.New(htlcswitch.Config{
DB: dbs.chanStateDB,
LocalChannelClose: func(pubKey []byte,
@ -519,6 +522,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
RejectHTLC: cfg.RejectHTLC,
Clock: clock.NewDefaultClock(),
HTLCExpiry: htlcswitch.DefaultHTLCExpiry,
DustThreshold: thresholdMSats,
}, uint32(currentHeight))
if err != nil {
return nil, err