aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2014-09-14 19:27:22 -0400
committerJeff Garzik <jgarzik@bitpay.com>2014-09-14 19:27:22 -0400
commita0a8700bc84cf10d99d9d3699e7b0fdfc323cf1c (patch)
treeb80a2a7c31b8f6e1dd0ff6efbdadb1c8bd29ce53 /src
parent512fcbcb195fedef268b1f4112ff747de34ba425 (diff)
parenta65e320747133723f02c1947a4cc257214325b0b (diff)
downloadbitcoin-a0a8700bc84cf10d99d9d3699e7b0fdfc323cf1c.tar.xz
Merge pull request #4909
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.test.include3
-rw-r--r--src/bitcoin-tx.cpp3
-rw-r--r--src/test/data/bitcoin-util-test.json3
-rw-r--r--src/test/data/txcreate2.hex1
4 files changed, 7 insertions, 3 deletions
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index b4360831bb..ab449f3e71 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -13,7 +13,8 @@ EXTRA_DIST += \
test/data/tt-delout1-out.hex \
test/data/tt-locktime317000-out.hex \
test/data/tx394b54bb.hex \
- test/data/txcreate1.hex
+ test/data/txcreate1.hex \
+ test/data/txcreate2.hex
JSON_TEST_FILES = \
test/data/script_valid.json \
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp
index 91525b51c9..70819ff2e5 100644
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -237,8 +237,7 @@ static void MutateTxAddOutScript(CMutableTransaction& tx, const string& strInput
// separate VALUE:SCRIPT in string
size_t pos = strInput.find(':');
if ((pos == string::npos) ||
- (pos == 0) ||
- (pos == (strInput.size() - 1)))
+ (pos == 0))
throw runtime_error("TX output missing separator");
// extract and validate VALUE
diff --git a/src/test/data/bitcoin-util-test.json b/src/test/data/bitcoin-util-test.json
index 7db87d7c11..cb74d73ef2 100644
--- a/src/test/data/bitcoin-util-test.json
+++ b/src/test/data/bitcoin-util-test.json
@@ -34,5 +34,8 @@
"outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
"outaddr=4:1P8yWvZW8jVihP1bzHeqfE4aoXNX8AVa46"],
"output_cmp": "txcreate1.hex"
+ },
+ { "exec": ["./bitcoin-tx", "-create", "outscript=0:"],
+ "output_cmp": "txcreate2.hex"
}
]
diff --git a/src/test/data/txcreate2.hex b/src/test/data/txcreate2.hex
new file mode 100644
index 0000000000..5243c2d02e
--- /dev/null
+++ b/src/test/data/txcreate2.hex
@@ -0,0 +1 @@
+01000000000100000000000000000000000000