Skip to content

Commit 7451cf5

Browse files
committed
Allow bitcoin-tx to parse partial transactions
Restore pre V0.13.1 functionality to bitcoin-tx and allow it to parse 0-input partial transactions.
1 parent ed64bce commit 7451cf5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/bitcoin-tx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ static int CommandLineRawTx(int argc, char* argv[])
629629
if (strHexTx == "-") // "-" implies standard input
630630
strHexTx = readStdin();
631631

632-
if (!DecodeHexTx(txDecodeTmp, strHexTx))
632+
if (!DecodeHexTx(txDecodeTmp, strHexTx, true))
633633
throw runtime_error("invalid transaction encoding");
634634

635635
startArg = 2;

src/test/data/bitcoin-util-test.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@
102102
"output_cmp": "txcreate2.json",
103103
"description": "Creates a new transaction with a single empty output script (output in json)"
104104
},
105+
{ "exec": "./bitcoin-tx",
106+
"args": ["01000000000100000000000000000000000000"],
107+
"output_cmp": "txcreate2.hex",
108+
"description": "Parses a transation with no inputs and a single output script"
109+
},
110+
{ "exec": "./bitcoin-tx",
111+
"args": ["-json", "01000000000100000000000000000000000000"],
112+
"output_cmp": "txcreate2.json",
113+
"description": "Parses a transation with no inputs and a single output script (output in json)"
114+
},
105115
{ "exec": "./bitcoin-tx",
106116
"args":
107117
["-create",

0 commit comments

Comments
 (0)