Skip to content

Commit ed6a246

Browse files
committed
rpcserver: add robustness check
1 parent 5486f32 commit ed6a246

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
@@ -2739,6 +2739,14 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
27392739
return err
27402740
}
27412741

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

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

0 commit comments

Comments
 (0)