aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.cpp
diff options
context:
space:
mode:
authorAndrew Chow <[email protected]>2018-11-06 09:23:37 -0500
committerAndrew Chow <[email protected]>2019-02-14 17:58:25 -0500
commiteab63bc264a35cf21738e8535773e3d36524c3fe (patch)
tree557800411c6e5918e1768b0c215cb1fe68df54f3 /src/wallet/walletdb.cpp
parentRemove hdmasterkeyid (diff)
downloaddiscoin-eab63bc264a35cf21738e8535773e3d36524c3fe.tar.xz
discoin-eab63bc264a35cf21738e8535773e3d36524c3fe.zip
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.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index 6e7b944e4..2783f83fd 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;
}