multi: thread through the new max fee field for co-op close

In this commit, we parse the new max fee field, and pass it through the
switch, all the way to the peer where it's ultimately passed into the
chan closer state machine.
This commit is contained in:
Olaoluwa Osuntokun committed 2022-07-26 17:23:16 -07:00
1 parent c791b18cc0
commit 1e556aa189
4 files changed
+20 -3

No files matched your search

+7
View File
@@ -2697,6 +2697,12 @@ func (p *Brontide) createChanCloser(channel *lnwallet.LightningChannel,
return nil, fmt.Errorf("cannot obtain best block")
}
// The req will only be set if we initaited the co-op closing flow.
var maxFee chainfee.SatPerKWeight
if req != nil {
maxFee = req.MaxFee
}
chanCloser := chancloser.NewChanCloser(
chancloser.ChanCloseCfg{
Channel: channel,
@@ -2706,6 +2712,7 @@ func (p *Brontide) createChanCloser(channel *lnwallet.LightningChannel,
op, false,
)
},
MaxFee: maxFee,
Disconnect: func() error {
return p.cfg.DisconnectPeer(p.IdentityKey())
},