diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index e09afd632..66c2166fe 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -629,7 +629,7 @@ static int CommandLineRawTx(int argc, char* argv[]) if (strHexTx == "-") // "-" implies standard input strHexTx = readStdin(); - if (!DecodeHexTx(txDecodeTmp, strHexTx)) + if (!DecodeHexTx(txDecodeTmp, strHexTx, true)) throw runtime_error("invalid transaction encoding"); startArg = 2; diff --git a/src/test/data/bitcoin-util-test.json b/src/test/data/bitcoin-util-test.json index de9504459..98be75919 100644 --- a/src/test/data/bitcoin-util-test.json +++ b/src/test/data/bitcoin-util-test.json @@ -102,6 +102,16 @@ "output_cmp": "txcreate2.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", "args": ["-create",