aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-12-09 16:14:48 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-12-09 16:14:54 -0800
commit815640ec6af9a38d6a2da4a4400056e2f4105080 (patch)
tree582aa4cbf6f7ffd507be728887f2c5538bad919e /qa/rpc-tests
parent72bf1b3d0962304850a3ef5fe375db4bff1d0a39 (diff)
parent1a6eacbf3b7e3d5941fec1154079bbc4678ce861 (diff)
downloadbitcoin-815640ec6af9a38d6a2da4a4400056e2f4105080.tar.xz
Merge #9295: [Wallet] Bugfix: Fundrawtransaction: don't terminate when keypool is empty
1a6eacb [QA] add fundrawtransaction test on a locked wallet with empty keypool (Jonas Schnelli) c24a4f5 [Wallet] Bugfix: FRT: don't terminate when keypool is empty (Jonas Schnelli)
Diffstat (limited to 'qa/rpc-tests')
-rwxr-xr-xqa/rpc-tests/fundrawtransaction.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/qa/rpc-tests/fundrawtransaction.py b/qa/rpc-tests/fundrawtransaction.py
index 8c45578fcf..0dcca4cb57 100755
--- a/qa/rpc-tests/fundrawtransaction.py
+++ b/qa/rpc-tests/fundrawtransaction.py
@@ -484,6 +484,23 @@ class RawTransactionsTest(BitcoinTestFramework):
self.is_network_split=False
self.sync_all()
+ # drain the keypool
+ self.nodes[1].getnewaddress()
+ inputs = []
+ outputs = {self.nodes[0].getnewaddress():1.1}
+ rawTx = self.nodes[1].createrawtransaction(inputs, outputs)
+ # fund a transaction that requires a new key for the change output
+ # creating the key must be impossible because the wallet is locked
+ try:
+ fundedTx = self.nodes[1].fundrawtransaction(rawTx)
+ raise AssertionError("Wallet unlocked without passphrase")
+ except JSONRPCException as e:
+ assert('Keypool ran out' in e.error['message'])
+
+ #refill the keypool
+ self.nodes[1].walletpassphrase("test", 100)
+ self.nodes[1].walletlock()
+
try:
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1.2)
raise AssertionError("Wallet unlocked without passphrase")