diff options
author | Andrew Chow <achow101-github@achow101.com> | 2018-11-06 09:23:37 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2019-02-14 17:58:25 -0500 |
commit | eab63bc264a35cf21738e8535773e3d36524c3fe (patch) | |
tree | 557800411c6e5918e1768b0c215cb1fe68df54f3 /src/wallet/walletdb.cpp | |
parent | 345bff6013e0d1a7eb0a08a071723b27f0460b77 (diff) | |
download | bitcoin-eab63bc264a35cf21738e8535773e3d36524c3fe.tar.xz |
Store key origin info in key metadata
Store the master key fingerprint and derivation path in the
key metadata. hdKeypath is kept to indicate the seed and for
backwards compatibility, but all key derivation path output
uses the key origin info instead of hdKeypath.
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r-- | src/wallet/walletdb.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 6e7b944e49..2783f83fd6 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -534,6 +534,14 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet) if (wss.fAnyUnordered) result = pwallet->ReorderTransactions(); + // Upgrade all of the wallet keymetadata to have the hd master key id + // This operation is not atomic, but if it fails, updated entries are still backwards compatible with older software + try { + pwallet->UpgradeKeyMetadata(); + } catch (...) { + result = DBErrors::CORRUPT; + } + return result; } |