mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-29 05:53:21 +02:00
use WalletContext scheduler for walletpassphrase callback
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test the wallet keypool and interaction with wallet encryption/locking."""
|
||||
|
||||
import time
|
||||
from decimal import Decimal
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
@@ -127,8 +126,10 @@ class KeyPoolTest(BitcoinTestFramework):
|
||||
nodes[0].keypoolrefill(3)
|
||||
|
||||
# test walletpassphrase timeout
|
||||
time.sleep(1.1)
|
||||
assert_equal(nodes[0].getwalletinfo()["unlocked_until"], 0)
|
||||
# CScheduler relies on condition_variable::wait_until() which does not
|
||||
# guarantee accurate timing. We'll wait up to 5 seconds to execute a 1
|
||||
# second scheduled event.
|
||||
nodes[0].wait_until(lambda: nodes[0].getwalletinfo()["unlocked_until"] == 0, timeout=5)
|
||||
|
||||
# drain the keypool
|
||||
for _ in range(3):
|
||||
|
Reference in New Issue
Block a user