mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-30 00:53:35 +02:00
htlcswitch: extend ChannelLink iface with dustHandler iface
This allows the Switch to determine the dust exposure of a certain channel and allows the link to set the feerate of the mailbox given a fee update.
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/go-errors/errors"
|
||||
sphinx "github.com/lightningnetwork/lightning-onion"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
@@ -717,6 +718,21 @@ func (f *mockChannelLink) handleLocalAddPacket(pkt *htlcPacket) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) getDustSum(remote bool) lnwire.MilliSatoshi {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) getFeeRate() chainfee.SatPerKWeight {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) getDustClosure() dustClosure {
|
||||
dustLimit := btcutil.Amount(400)
|
||||
return dustHelper(
|
||||
channeldb.SingleFunderTweaklessBit, dustLimit, dustLimit,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) HandleChannelUpdate(lnwire.Message) {
|
||||
}
|
||||
|
||||
@@ -742,6 +758,7 @@ func (f *mockChannelLink) Stats() (uint64, lnwire.MilliSatoshi, lnwire.MilliSato
|
||||
func (f *mockChannelLink) AttachMailBox(mailBox MailBox) {
|
||||
f.mailBox = mailBox
|
||||
f.packets = mailBox.PacketOutBox()
|
||||
mailBox.SetDustClosure(f.getDustClosure())
|
||||
}
|
||||
|
||||
func (f *mockChannelLink) Start() error {
|
||||
|
Reference in New Issue
Block a user