@@ -900,20 +900,22 @@ bool LegacyScriptPubKeyMan::AddWatchOnly(const CScript& dest, int64_t nCreateTim
900
900
return AddWatchOnly (dest);
901
901
}
902
902
903
- void LegacyScriptPubKeyMan::SetHDChain (const CHDChain& chain, bool memonly )
903
+ void LegacyScriptPubKeyMan::LoadHDChain (const CHDChain& chain)
904
904
{
905
905
LOCK (cs_KeyStore);
906
- // memonly == true means we are loading the wallet file
907
- // memonly == false means that the chain is actually being changed
908
- if (!memonly) {
909
- // Store the new chain
910
- if (!WalletBatch (m_storage.GetDatabase ()).WriteHDChain (chain)) {
911
- throw std::runtime_error (std::string (__func__) + " : writing chain failed" );
912
- }
913
- // When there's an old chain, add it as an inactive chain as we are now rotating hd chains
914
- if (!m_hd_chain.seed_id .IsNull ()) {
915
- AddInactiveHDChain (m_hd_chain);
916
- }
906
+ m_hd_chain = chain;
907
+ }
908
+
909
+ void LegacyScriptPubKeyMan::AddHDChain (const CHDChain& chain)
910
+ {
911
+ LOCK (cs_KeyStore);
912
+ // Store the new chain
913
+ if (!WalletBatch (m_storage.GetDatabase ()).WriteHDChain (chain)) {
914
+ throw std::runtime_error (std::string (__func__) + " : writing chain failed" );
915
+ }
916
+ // When there's an old chain, add it as an inactive chain as we are now rotating hd chains
917
+ if (!m_hd_chain.seed_id .IsNull ()) {
918
+ AddInactiveHDChain (m_hd_chain);
917
919
}
918
920
919
921
m_hd_chain = chain;
@@ -1167,7 +1169,7 @@ void LegacyScriptPubKeyMan::SetHDSeed(const CPubKey& seed)
1167
1169
CHDChain newHdChain;
1168
1170
newHdChain.nVersion = m_storage.CanSupportFeature (FEATURE_HD_SPLIT) ? CHDChain::VERSION_HD_CHAIN_SPLIT : CHDChain::VERSION_HD_BASE;
1169
1171
newHdChain.seed_id = seed.GetID ();
1170
- SetHDChain (newHdChain, false );
1172
+ AddHDChain (newHdChain);
1171
1173
NotifyCanGetAddressesChanged ();
1172
1174
WalletBatch batch (m_storage.GetDatabase ());
1173
1175
m_storage.UnsetBlankWalletFlag (batch);
0 commit comments