rpcserver: don't write any custom channel data if empty
This commit is contained in:
1 file changed
+5
@@ -4606,6 +4606,11 @@ func encodeCustomChanData(lnChan *channeldb.OpenChannel) ([]byte, error) {
|
|||||||
customOpenChanData := lnChan.CustomBlob.UnwrapOr(nil)
|
customOpenChanData := lnChan.CustomBlob.UnwrapOr(nil)
|
||||||
customLocalCommitData := lnChan.LocalCommitment.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
|
// 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
|
// set of var bytes encoding of the open chan data, the second is an
|
||||||
// encoding of the local commitment data.
|
// encoding of the local commitment data.
|
||||||
|
|||||||
Reference in new issue
Block a user