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 @@ -457,6 +457,23 @@ def run_test(self):
457457 self .is_network_split = False
458458 self .sync_all ()
459459
460+ # drain the keypool
461+ self .nodes [1 ].getnewaddress ()
462+ inputs = []
463+ outputs = {self .nodes [0 ].getnewaddress ():1.1 }
464+ rawTx = self .nodes [1 ].createrawtransaction (inputs , outputs )
465+ # fund a transaction that requires a new key for the change output
466+ # creating the key must be impossible because the wallet is locked
467+ try :
468+ fundedTx = self .nodes [1 ].fundrawtransaction (rawTx )
469+ raise AssertionError ("Wallet unlocked without passphrase" )
470+ except JSONRPCException as e :
471+ assert ('Keypool ran out' in e .error ['message' ])
472+
473+ #refill the keypool
474+ self .nodes [1 ].walletpassphrase ("test" , 100 )
475+ self .nodes [1 ].walletlock ()
476+
460477 try :
461478 self .nodes [1 ].sendtoaddress (self .nodes [0 ].getnewaddress (), 1.2 )
462479 raise AssertionError ("Wallet unlocked without passphrase" )
You can’t perform that action at this time.
0 commit comments