rpcserver: add robustness check

This commit is contained in:
ziggie 2024-11-13 17:22:30 +01:00
parent 5486f32444
commit ed6a246439
No known key found for this signature in database
GPG Key ID: 1AFF9C4DCED6D666

View File

@ -2739,6 +2739,14 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
return err
}
// Safety check which should never happen.
//
// TODO(ziggie): remove pointer as return value from
// ForceCloseContract.
if closingTx == nil {
return fmt.Errorf("force close transaction is nil")
}
closingTxid := closingTx.TxHash()
// With the transaction broadcast, we send our first update to