peer+chancloser: mark coop broadcasted
This commit is contained in:
parent
b3c28c9cba
commit
d9cf0396b3
@ -439,7 +439,7 @@ func (c *channelCloser) ProcessCloseMsg(msg lnwire.Message) ([]lnwire.Message, b
|
||||
// Before publishing the closing tx, we persist it to the
|
||||
// database, such that it can be republished if something goes
|
||||
// wrong.
|
||||
err = c.cfg.channel.MarkCommitmentBroadcasted(closeTx)
|
||||
err = c.cfg.channel.MarkCoopBroadcasted(closeTx)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
@ -487,7 +487,6 @@ func (c *channelCloser) ProcessCloseMsg(msg lnwire.Message) ([]lnwire.Message, b
|
||||
// transaction for a channel based on the prior fee negotiations and our
|
||||
// current compromise fee.
|
||||
func (c *channelCloser) proposeCloseSigned(fee btcutil.Amount) (*lnwire.ClosingSigned, error) {
|
||||
|
||||
rawSig, _, _, err := c.cfg.channel.CreateCloseProposal(
|
||||
fee, c.localDeliveryScript, c.remoteDeliveryScript,
|
||||
)
|
||||
|
@ -6382,6 +6382,16 @@ func (lc *LightningChannel) MarkCommitmentBroadcasted(tx *wire.MsgTx) error {
|
||||
return lc.channelState.MarkCommitmentBroadcasted(tx)
|
||||
}
|
||||
|
||||
// MarkCoopBroadcasted marks the channel as a cooperative close transaction has
|
||||
// been broadcast, and that we should watch the chain for it to confirm before
|
||||
// taking any further action.
|
||||
func (lc *LightningChannel) MarkCoopBroadcasted(tx *wire.MsgTx) error {
|
||||
lc.Lock()
|
||||
defer lc.Unlock()
|
||||
|
||||
return lc.channelState.MarkCoopBroadcasted(tx)
|
||||
}
|
||||
|
||||
// MarkDataLoss marks sets the channel status to LocalDataLoss and stores the
|
||||
// passed commitPoint for use to retrieve funds in case the remote force closes
|
||||
// the channel.
|
||||
|
2
peer.go
2
peer.go
@ -463,6 +463,8 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) (
|
||||
fallthrough
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusCommitBroadcasted):
|
||||
fallthrough
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusCoopBroadcasted):
|
||||
fallthrough
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusLocalDataLoss):
|
||||
peerLog.Warnf("ChannelPoint(%v) has status %v, won't "+
|
||||
"start.", chanPoint, dbChan.ChanStatus())
|
||||
|
Loading…
Reference in New Issue
Block a user