Skip to content

Commit

Permalink
rpcserver: add robustness check
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggie1984 committed Nov 15, 2024
1 parent 9cc5391 commit 1be7948
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1be7948

Please sign in to comment.