aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/fundrawtransaction.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-12-14 10:18:18 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-12-14 10:18:23 +0100
commitc1b7421781b7a53485c6db4a6005a80e32267c9f (patch)
treec6cab5ae1ea5041502b2865f08fe05dd9b147e4c /qa/rpc-tests/fundrawtransaction.py
parentec0afbd52b787ac0c8d49ad1b6c9dfa98d725b03 (diff)
parentd6098956c34719cd833a645b21d3d8f1be0a9d17 (diff)
Merge #9211: [0.12 branch] Backportsv0.12-final
d609895 [Wallet] Bugfix: FRT: don't terminate when keypool is empty (Jonas Schnelli) 8dee97f [QA] add fundrawtransaction test on a locked wallet with empty keypool (Jonas Schnelli) 82e29e8 torcontrol: Explicitly request RSA1024 private key (Wladimir J. van der Laan) cca151b Send tip change notification from invalidateblock (Russell Yanofsky) ad99a79 [rpcwallet] Don't use floating point (MarcoFalke)
Diffstat (limited to 'qa/rpc-tests/fundrawtransaction.py')
-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 10dee6dbc8..fedf511046 100755
--- a/qa/rpc-tests/fundrawtransaction.py
+++ b/qa/rpc-tests/fundrawtransaction.py
@@ -457,6 +457,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")