mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-19 13:17:32 +02:00
walletrpc: allow both txid fields populated during OutPoint unmarshall
This commit is contained in:
parent
72a89520d4
commit
51e2da6fbc
1 changed files with 3 additions and 5 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue