Skip to content

Commit

Permalink
rpcserver: don't write any custom channel data if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Oct 15, 2024
1 parent 7bf9b59 commit 5d60da5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4606,6 +4606,11 @@ func encodeCustomChanData(lnChan *channeldb.OpenChannel) ([]byte, error) {
customOpenChanData := lnChan.CustomBlob.UnwrapOr(nil)
customLocalCommitData := lnChan.LocalCommitment.CustomBlob.UnwrapOr(nil)

// Don't write any custom data if both blobs are empty.
if len(customOpenChanData) == 0 && len(customLocalCommitData) == 0 {
return nil, nil
}

// We'll encode our custom channel data as two blobs. The first is a
// set of var bytes encoding of the open chan data, the second is an
// encoding of the local commitment data.
Expand Down

0 comments on commit 5d60da5

Please sign in to comment.