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
2022-07-26 16:41:59 -07:00
parent c791b18cc0
commit 1e556aa189
4 changed files with 20 additions and 3 deletions

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())
},