Merge pull request #4525 from guggero/no-restore-close
rpcserver: no manual close of restored channels
This commit is contained in:
4 files changed
+1085
-1002
No files matched your search
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -137,6 +137,7 @@
|
|||||||
<time> [ERR] RPCS: [/chainrpc.ChainNotifier/RegisterBlockEpochNtfn]: chain notifier shutting down
|
<time> [ERR] RPCS: [/chainrpc.ChainNotifier/RegisterBlockEpochNtfn]: chain notifier shutting down
|
||||||
<time> [ERR] RPCS: [/chainrpc.ChainNotifier/RegisterBlockEpochNtfn]: context canceled
|
<time> [ERR] RPCS: [/chainrpc.ChainNotifier/RegisterBlockEpochNtfn]: context canceled
|
||||||
<time> [ERR] RPCS: [/invoicesrpc.Invoices/SubscribeSingleInvoice]: rpc error: code = Canceled desc = context canceled
|
<time> [ERR] RPCS: [/invoicesrpc.Invoices/SubscribeSingleInvoice]: rpc error: code = Canceled desc = context canceled
|
||||||
|
<time> [ERR] RPCS: [/lnrpc.Lightning/CloseChannel]: cannot close channel with state: ChanStatusRestored
|
||||||
<time> [ERR] RPCS: [/lnrpc.Lightning/CloseChannel]: cannot co-op close frozen channel as initiator until height=<height>, (current_height=<height>)
|
<time> [ERR] RPCS: [/lnrpc.Lightning/CloseChannel]: cannot co-op close frozen channel as initiator until height=<height>, (current_height=<height>)
|
||||||
<time> [ERR] RPCS: [/lnrpc.Lightning/CloseChannel]: cannot co-op close frozen channel as initiator until height=3059, (current_height=3055)
|
<time> [ERR] RPCS: [/lnrpc.Lightning/CloseChannel]: cannot co-op close frozen channel as initiator until height=3059, (current_height=3055)
|
||||||
<time> [ERR] RPCS: [/lnrpc.Lightning/CloseChannel]: chain notifier shutting down
|
<time> [ERR] RPCS: [/lnrpc.Lightning/CloseChannel]: chain notifier shutting down
|
||||||
|
|||||||
@@ -2072,6 +2072,19 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We can't coop or force close restored channels or channels that have
|
||||||
|
// experienced local data loss. Normally we would detect this in the
|
||||||
|
// channel arbitrator if the channel has the status
|
||||||
|
// ChanStatusLocalDataLoss after connecting to its peer. But if no
|
||||||
|
// connection can be established, the channel arbitrator doesn't know it
|
||||||
|
// can't be force closed yet.
|
||||||
|
if channel.HasChanStatus(channeldb.ChanStatusRestored) ||
|
||||||
|
channel.HasChanStatus(channeldb.ChanStatusLocalDataLoss) {
|
||||||
|
|
||||||
|
return fmt.Errorf("cannot close channel with state: %v",
|
||||||
|
channel.ChanStatus())
|
||||||
|
}
|
||||||
|
|
||||||
// Retrieve the best height of the chain, which we'll use to complete
|
// Retrieve the best height of the chain, which we'll use to complete
|
||||||
// either closing flow.
|
// either closing flow.
|
||||||
_, bestHeight, err := r.server.cc.chainIO.GetBestBlock()
|
_, bestHeight, err := r.server.cc.chainIO.GetBestBlock()
|
||||||
|
|||||||
Reference in new issue
Block a user