aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorGregory Sanders <gsanders87@gmail.com>2017-04-28 17:22:37 -0400
committerGregory Sanders <gsanders87@gmail.com>2017-05-01 08:07:09 -0400
commit7c588637d467bfa18f48a7ca71c0700f90833ea1 (patch)
treed31d99a9307803e8011c62164acbc23e50775608 /test/functional
parent4c924011f535c46b3bc02bef8b7e2a8ad559d78d (diff)
[Wallet] unset change position when there is no change on exact match
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/fundrawtransaction.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/fundrawtransaction.py b/test/functional/fundrawtransaction.py
index b86ea2d877..e0ca94a6b3 100755
--- a/test/functional/fundrawtransaction.py
+++ b/test/functional/fundrawtransaction.py
@@ -53,6 +53,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)