Browse Source

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.
0.14
jnewbery 8 years ago committed by John Newbery
parent
commit
7451cf59cd
  1. 2
      src/bitcoin-tx.cpp
  2. 10
      src/test/data/bitcoin-util-test.json

2
src/bitcoin-tx.cpp

@ -629,7 +629,7 @@ static int CommandLineRawTx(int argc, char* argv[])
if (strHexTx == "-") // "-" implies standard input if (strHexTx == "-") // "-" implies standard input
strHexTx = readStdin(); strHexTx = readStdin();
if (!DecodeHexTx(txDecodeTmp, strHexTx)) if (!DecodeHexTx(txDecodeTmp, strHexTx, true))
throw runtime_error("invalid transaction encoding"); throw runtime_error("invalid transaction encoding");
startArg = 2; startArg = 2;

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

@ -102,6 +102,16 @@
"output_cmp": "txcreate2.json", "output_cmp": "txcreate2.json",
"description": "Creates a new transaction with a single empty output script (output in json)" "description": "Creates a new transaction with a single empty output script (output in json)"
}, },
{ "exec": "./bitcoin-tx",
"args": ["01000000000100000000000000000000000000"],
"output_cmp": "txcreate2.hex",
"description": "Parses a transation with no inputs and a single output script"
},
{ "exec": "./bitcoin-tx",
"args": ["-json", "01000000000100000000000000000000000000"],
"output_cmp": "txcreate2.json",
"description": "Parses a transation with no inputs and a single output script (output in json)"
},
{ "exec": "./bitcoin-tx", { "exec": "./bitcoin-tx",
"args": "args":
["-create", ["-create",

Loading…
Cancel
Save