diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2019-10-23 15:21:50 +0200 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2020-02-04 11:20:25 +0100 |
commit | 92bcd70808b9cac56b184903aa6d37baf9641b37 (patch) | |
tree | 0faa43d78dc9851c88308ef0c5a5943b9379fe32 /test/functional/rpc_fundrawtransaction.py | |
parent | 709f8685ac37510aa145ac259753583c82280038 (diff) |
[wallet] allow transaction without change if keypool is empty
Diffstat (limited to 'test/functional/rpc_fundrawtransaction.py')
-rwxr-xr-x | test/functional/rpc_fundrawtransaction.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/functional/rpc_fundrawtransaction.py b/test/functional/rpc_fundrawtransaction.py index 8a2dc7e916..03c5271058 100755 --- a/test/functional/rpc_fundrawtransaction.py +++ b/test/functional/rpc_fundrawtransaction.py @@ -500,11 +500,16 @@ class RawTransactionsTest(BitcoinTestFramework): self.nodes[1].getnewaddress() self.nodes[1].getrawchangeaddress() inputs = [] - outputs = {self.nodes[0].getnewaddress():1.1} + outputs = {self.nodes[0].getnewaddress():1.09999500} rawtx = self.nodes[1].createrawtransaction(inputs, outputs) + # fund a transaction that does not require a new key for the change output + self.nodes[1].fundrawtransaction(rawtx) + # fund a transaction that requires a new key for the change output # creating the key must be impossible because the wallet is locked - assert_raises_rpc_error(-4, "Can't generate a change-address key. Please call keypoolrefill first.", self.nodes[1].fundrawtransaction, rawtx) + outputs = {self.nodes[0].getnewaddress():1.1} + rawtx = self.nodes[1].createrawtransaction(inputs, outputs) + assert_raises_rpc_error(-4, "Transaction needs a change address, but we can't generate it. Please call keypoolrefill first.", self.nodes[1].fundrawtransaction, rawtx) # Refill the keypool. self.nodes[1].walletpassphrase("test", 100) |