From 51e2da6fbc47061bdb87e32d94d44f4ccbc952ae Mon Sep 17 00:00:00 2001 From: ffranr Date: Wed, 14 Jun 2023 14:07:04 +0100 Subject: [PATCH] walletrpc: allow both txid fields populated during OutPoint unmarshall --- lnrpc/walletrpc/walletkit_server.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lnrpc/walletrpc/walletkit_server.go b/lnrpc/walletrpc/walletkit_server.go index 36a48a5aa..9fff649ee 100644 --- a/lnrpc/walletrpc/walletkit_server.go +++ b/lnrpc/walletrpc/walletkit_server.go @@ -816,12 +816,10 @@ func UnmarshallOutPoint(op *lnrpc.OutPoint) (*wire.OutPoint, error) { var hash chainhash.Hash switch { + // Return an error if both txid fields are unpopulated. case len(op.TxidBytes) == 0 && len(op.TxidStr) == 0: - fallthrough - - case len(op.TxidBytes) != 0 && len(op.TxidStr) != 0: - return nil, fmt.Errorf("either TxidBytes or TxidStr must be " + - "specified, but not both") + return nil, fmt.Errorf("TxidBytes and TxidStr are both " + + "unspecified") // The hash was provided as raw bytes. case len(op.TxidBytes) != 0: