mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 11:53:24 +02:00
walletrpc: allow both txid fields populated during OutPoint unmarshall
This commit is contained in:
@@ -816,12 +816,10 @@ func UnmarshallOutPoint(op *lnrpc.OutPoint) (*wire.OutPoint, error) {
|
|||||||
|
|
||||||
var hash chainhash.Hash
|
var hash chainhash.Hash
|
||||||
switch {
|
switch {
|
||||||
|
// Return an error if both txid fields are unpopulated.
|
||||||
case len(op.TxidBytes) == 0 && len(op.TxidStr) == 0:
|
case len(op.TxidBytes) == 0 && len(op.TxidStr) == 0:
|
||||||
fallthrough
|
return nil, fmt.Errorf("TxidBytes and TxidStr are both " +
|
||||||
|
"unspecified")
|
||||||
case len(op.TxidBytes) != 0 && len(op.TxidStr) != 0:
|
|
||||||
return nil, fmt.Errorf("either TxidBytes or TxidStr must be " +
|
|
||||||
"specified, but not both")
|
|
||||||
|
|
||||||
// The hash was provided as raw bytes.
|
// The hash was provided as raw bytes.
|
||||||
case len(op.TxidBytes) != 0:
|
case len(op.TxidBytes) != 0:
|
||||||
|
Reference in New Issue
Block a user