Skip to content

Commit d695383

Browse files
ziggie1984guggero
authored andcommitted
rpcserver: add robustness check
1 parent 79d0655 commit d695383

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rpcserver.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,6 +2736,14 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
27362736
return err
27372737
}
27382738

2739+
// Safety check which should never happen.
2740+
//
2741+
// TODO(ziggie): remove pointer as return value from
2742+
// ForceCloseContract.
2743+
if closingTx == nil {
2744+
return fmt.Errorf("force close transaction is nil")
2745+
}
2746+
27392747
closingTxid := closingTx.TxHash()
27402748

27412749
// With the transaction broadcast, we send our first update to

0 commit comments

Comments
 (0)