Skip to content

Commit

Permalink
walletrpc: allow both txid fields populated during OutPoint unmarshall
Browse files Browse the repository at this point in the history
  • Loading branch information
ffranr committed Jun 14, 2023
1 parent b6f04e1 commit 4b5df4e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lnrpc/walletrpc/walletkit_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4b5df4e

Please sign in to comment.