chancloser: move nil MarkCoopBroadcasted to BeginNegotiation
This commit is contained in:
1 parent
1b0f97a483
commit
3aceeea4f3
1 file changed
+12
-10
@@ -345,16 +345,6 @@ func (c *ChanCloser) initChanShutdown() (*lnwire.Shutdown, error) {
|
|||||||
c.chanPoint, err)
|
c.chanPoint, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Before continuing, mark the channel as cooperatively closed with a
|
|
||||||
// nil txn. Even though we haven't negotiated the final txn, this
|
|
||||||
// guarantees that our listchannels rpc will be externally consistent,
|
|
||||||
// and reflect that the channel is being shutdown by the time the
|
|
||||||
// closing request returns.
|
|
||||||
err := c.cfg.Channel.MarkCoopBroadcasted(nil, c.locallyInitiated)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
chancloserLog.Infof("ChannelPoint(%v): sending shutdown message",
|
chancloserLog.Infof("ChannelPoint(%v): sending shutdown message",
|
||||||
c.chanPoint)
|
c.chanPoint)
|
||||||
|
|
||||||
@@ -627,6 +617,18 @@ func (c *ChanCloser) BeginNegotiation() (
|
|||||||
// compute what our max/ideal fee will be.
|
// compute what our max/ideal fee will be.
|
||||||
c.initFeeBaseline()
|
c.initFeeBaseline()
|
||||||
|
|
||||||
|
// Before continuing, mark the channel as cooperatively closed
|
||||||
|
// with a nil txn. Even though we haven't negotiated the final
|
||||||
|
// txn, this guarantees that our listchannels rpc will be
|
||||||
|
// externally consistent, and reflect that the channel is being
|
||||||
|
// shutdown by the time the closing request returns.
|
||||||
|
err := c.cfg.Channel.MarkCoopBroadcasted(
|
||||||
|
nil, c.locallyInitiated,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return noClosingSigned, err
|
||||||
|
}
|
||||||
|
|
||||||
// At this point, we can now start the fee negotiation state, by
|
// At this point, we can now start the fee negotiation state, by
|
||||||
// constructing and sending our initial signature for what we
|
// constructing and sending our initial signature for what we
|
||||||
// think the closing transaction should look like.
|
// think the closing transaction should look like.
|
||||||
|
|||||||
Reference in new issue
Block a user