rpcserver: add robustness check

This commit is contained in:
ziggie 2024-11-13 17:22:30 +01:00 committed by Oliver Gugger
parent 79d0655a96
commit d695383386
No known key found for this signature in database
GPG key ID: 8E4256593F177720

View file

@ -2736,6 +2736,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