mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
chancloser: move nil MarkCoopBroadcasted to BeginNegotiation
This commit is contained in:
parent
1b0f97a483
commit
3aceeea4f3
1 changed files with 12 additions and 10 deletions
|
@ -345,16 +345,6 @@ func (c *ChanCloser) initChanShutdown() (*lnwire.Shutdown, error) {
|
|||
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",
|
||||
c.chanPoint)
|
||||
|
||||
|
@ -627,6 +617,18 @@ func (c *ChanCloser) BeginNegotiation() (
|
|||
// compute what our max/ideal fee will be.
|
||||
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
|
||||
// constructing and sending our initial signature for what we
|
||||
// think the closing transaction should look like.
|
||||
|
|
Loading…
Add table
Reference in a new issue