multi: add bool param to channel enable/disable methods

Add a new boolean parameter without changing any existing
functionality. The parameter will be used to indicate
whether a request to update a channel's status was made
manually by a user (currently always false).
This commit is contained in:
Elliott Jin committed 2021-02-24 07:13:28 -08:00
1 parent db23e34f74
commit e9baf0e4a2
4 files changed
+31 -15

No files matched your search

+7 -3
View File
@@ -2285,7 +2285,7 @@ func (p *Brontide) reenableActiveChannels() {
// disabled bit to false and send out a new ChannelUpdate. If this
// channel is already active, the update won't be sent.
for _, chanPoint := range activePublicChans {
err := p.cfg.ChanStatusMgr.RequestEnable(chanPoint)
err := p.cfg.ChanStatusMgr.RequestEnable(chanPoint, false)
if err != nil {
peerLog.Errorf("Unable to enable channel %v: %v",
chanPoint, err)
@@ -2360,7 +2360,9 @@ func (p *Brontide) fetchActiveChanCloser(chanID lnwire.ChannelID) (
Channel: channel,
UnregisterChannel: p.cfg.Switch.RemoveLink,
BroadcastTx: p.cfg.Wallet.PublishTransaction,
DisableChannel: p.cfg.ChanStatusMgr.RequestDisable,
DisableChannel: func(chanPoint wire.OutPoint) error {
return p.cfg.ChanStatusMgr.RequestDisable(chanPoint, false)
},
Disconnect: func() error {
return p.cfg.DisconnectPeer(p.IdentityKey())
},
@@ -2476,7 +2478,9 @@ func (p *Brontide) handleLocalCloseReq(req *htlcswitch.ChanClose) {
Channel: channel,
UnregisterChannel: p.cfg.Switch.RemoveLink,
BroadcastTx: p.cfg.Wallet.PublishTransaction,
DisableChannel: p.cfg.ChanStatusMgr.RequestDisable,
DisableChannel: func(chanPoint wire.OutPoint) error {
return p.cfg.ChanStatusMgr.RequestDisable(chanPoint, false)
},
Disconnect: func() error {
return p.cfg.DisconnectPeer(p.IdentityKey())
},