Merge pull request #8824 from Crypt-iQ/precise_dust_limit

multi: include commitment fees in dust calculation
This commit is contained in:
Oliver Gugger authored and GitHub committed 2024-07-31 03:13:31 -06:00
commit ac4ef28926
13 files changed
+461 -89

No files matched your search

+6 -2
View File
@@ -636,7 +636,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
s.htlcNotifier = htlcswitch.NewHtlcNotifier(time.Now)
thresholdSats := btcutil.Amount(cfg.DustThreshold)
thresholdSats := btcutil.Amount(cfg.MaxFeeExposure)
thresholdMSats := lnwire.NewMSatFromSatoshis(thresholdSats)
s.aliasMgr, err = aliasmgr.NewManager(dbs.ChanStateDB)
@@ -676,7 +676,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
RejectHTLC: cfg.RejectHTLC,
Clock: clock.NewDefaultClock(),
MailboxDeliveryTimeout: cfg.Htlcswitch.MailboxDeliveryTimeout,
DustThreshold: thresholdMSats,
MaxFeeExposure: thresholdMSats,
SignAliasUpdate: s.signAliasUpdate,
IsAlias: aliasmgr.IsAlias,
}, uint32(currentHeight))
@@ -3861,6 +3861,9 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq,
towerClient = s.towerClientMgr
}
thresholdSats := btcutil.Amount(s.cfg.MaxFeeExposure)
thresholdMSats := lnwire.NewMSatFromSatoshis(thresholdSats)
// Now that we've established a connection, create a peer, and it to the
// set of currently active peers. Configure the peer with the incoming
// and outgoing broadcast deltas to prevent htlcs from being accepted or
@@ -3930,6 +3933,7 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq,
RequestAlias: s.aliasMgr.RequestAlias,
AddLocalAlias: s.aliasMgr.AddLocalAlias,
DisallowRouteBlinding: s.cfg.ProtocolOptions.NoRouteBlinding(),
MaxFeeExposure: thresholdMSats,
Quit: s.quit,
}