mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
Merge bitcoin/bitcoin#33031: wallet: Set descriptor cache upgraded flag for migrated wallets
88b0647f02wallet: Always write last hardened cache flag in migrated wallets (Ava Chow)8a08eef645tests: Check that the last hardened cache upgrade occurs (Ava Chow) Pull request description: #32597 set the descriptor cache upgraded flag for newly created wallets, but migrated wallets still did not have the flag set when they are migrated. For consistency, and to avoid an unnecessary upgrade, we should be setting this flag for migrated wallets. The flag would end up being set anyways at the end of migration when the wallet is reloaded as it would perform the automatic upgrade at that time. However, this is unnecessary and we should just set it from the get go. This PR also adds a couple tests to verify that the flag is being set, and that the upgrade is being performed. ACKs for top commit: cedwies: re-ACK88b0647rkrux: lgtm ACK88b0647f02pablomartin4btc: ACK88b0647f02Tree-SHA512: 7d0850db0ae38eedd1e6a3bfaa548c6c612182291059fb1a47279a4c4984ee7914ecd02d8c7e427ef67bf9f5e67cbc57a7ae4412fad539e1bf3e05c512a60d69
This commit is contained in:
@@ -1110,3 +1110,15 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
if self.options.usecli:
|
||||
return json.dumps(text)
|
||||
return text
|
||||
|
||||
def inspect_sqlite_db(self, path, fn, *args, **kwargs):
|
||||
try:
|
||||
import sqlite3 # type: ignore[import]
|
||||
conn = sqlite3.connect(path)
|
||||
with conn:
|
||||
result = fn(conn, *args, **kwargs)
|
||||
conn.close()
|
||||
return result
|
||||
except ImportError:
|
||||
self.log.warning("sqlite3 module not available, skipping tests that inspect the database")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user