File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -484,6 +484,23 @@ def run_test(self):
484
484
self .is_network_split = False
485
485
self .sync_all ()
486
486
487
+ # drain the keypool
488
+ self .nodes [1 ].getnewaddress ()
489
+ inputs = []
490
+ outputs = {self .nodes [0 ].getnewaddress ():1.1 }
491
+ rawTx = self .nodes [1 ].createrawtransaction (inputs , outputs )
492
+ # fund a transaction that requires a new key for the change output
493
+ # creating the key must be impossible because the wallet is locked
494
+ try :
495
+ fundedTx = self .nodes [1 ].fundrawtransaction (rawTx )
496
+ raise AssertionError ("Wallet unlocked without passphrase" )
497
+ except JSONRPCException as e :
498
+ assert ('Keypool ran out' in e .error ['message' ])
499
+
500
+ #refill the keypool
501
+ self .nodes [1 ].walletpassphrase ("test" , 100 )
502
+ self .nodes [1 ].walletlock ()
503
+
487
504
try :
488
505
self .nodes [1 ].sendtoaddress (self .nodes [0 ].getnewaddress (), 1.2 )
489
506
raise AssertionError ("Wallet unlocked without passphrase" )
You can’t perform that action at this time.
0 commit comments