aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGregory Sanders <gsanders87@gmail.com>2017-04-28 17:22:37 -0400
committerJonas Schnelli <dev@jonasschnelli.ch>2017-05-31 10:57:16 +0200
commit18476423fba5d2cadd2b0973e425a6ebedeb66a4 (patch)
tree05608fb0fb49463e9aa652b1e590ed70222aac24 /qa
parentae479bc45bfdfb33e7f1293391db5b9f81b3ce17 (diff)
downloadbitcoin-18476423fba5d2cadd2b0973e425a6ebedeb66a4.tar.xz
[Wallet] unset change position when there is no change on exact match
Diffstat (limited to 'qa')
-rwxr-xr-xqa/rpc-tests/fundrawtransaction.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/qa/rpc-tests/fundrawtransaction.py b/qa/rpc-tests/fundrawtransaction.py
index 8d2bc73c0c..cdea390e22 100755
--- a/qa/rpc-tests/fundrawtransaction.py
+++ b/qa/rpc-tests/fundrawtransaction.py
@@ -54,6 +54,11 @@ class RawTransactionsTest(BitcoinTestFramework):
self.nodes[0].generate(121)
self.sync_all()
+ # ensure that setting changePosition in fundraw with an exact match is handled properly
+ rawmatch = self.nodes[2].createrawtransaction([], {self.nodes[2].getnewaddress():50})
+ rawmatch = self.nodes[2].fundrawtransaction(rawmatch, {"changePosition":1, "subtractFeeFromOutputs":[0]})
+ assert_equal(rawmatch["changepos"], -1)
+
watchonly_address = self.nodes[0].getnewaddress()
watchonly_pubkey = self.nodes[0].validateaddress(watchonly_address)["pubkey"]
watchonly_amount = Decimal(200)