@@ -354,7 +354,7 @@ bool LoadKey(CWallet* pwallet, DataStream& ssKey, DataStream& ssValue, std::stri
354
354
strErr = " Error reading wallet database: CPrivKey corrupt" ;
355
355
return false ;
356
356
}
357
- if (!pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadKey (key, vchPubKey))
357
+ if (!pwallet->GetOrCreateLegacyDataSPKM ()->LoadKey (key, vchPubKey))
358
358
{
359
359
strErr = " Error reading wallet database: LegacyDataSPKM::LoadKey failed" ;
360
360
return false ;
@@ -393,7 +393,7 @@ bool LoadCryptedKey(CWallet* pwallet, DataStream& ssKey, DataStream& ssValue, st
393
393
}
394
394
}
395
395
396
- if (!pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadCryptedKey (vchPubKey, vchPrivKey, checksum_valid))
396
+ if (!pwallet->GetOrCreateLegacyDataSPKM ()->LoadCryptedKey (vchPubKey, vchPrivKey, checksum_valid))
397
397
{
398
398
strErr = " Error reading wallet database: LegacyDataSPKM::LoadCryptedKey failed" ;
399
399
return false ;
@@ -440,7 +440,7 @@ bool LoadHDChain(CWallet* pwallet, DataStream& ssValue, std::string& strErr)
440
440
try {
441
441
CHDChain chain;
442
442
ssValue >> chain;
443
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadHDChain (chain);
443
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadHDChain (chain);
444
444
} catch (const std::exception& e) {
445
445
if (strErr.empty ()) {
446
446
strErr = e.what ();
@@ -584,7 +584,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
584
584
key >> hash;
585
585
CScript script;
586
586
value >> script;
587
- if (!pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadCScript (script))
587
+ if (!pwallet->GetOrCreateLegacyDataSPKM ()->LoadCScript (script))
588
588
{
589
589
strErr = " Error reading wallet database: LegacyDataSPKM::LoadCScript failed" ;
590
590
return DBErrors::NONCRITICAL_ERROR;
@@ -607,7 +607,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
607
607
key >> vchPubKey;
608
608
CKeyMetadata keyMeta;
609
609
value >> keyMeta;
610
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadKeyMetadata (vchPubKey.GetID (), keyMeta);
610
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadKeyMetadata (vchPubKey.GetID (), keyMeta);
611
611
612
612
// Extract some CHDChain info from this metadata if it has any
613
613
if (keyMeta.nVersion >= CKeyMetadata::VERSION_WITH_HDDATA && !keyMeta.hd_seed_id .IsNull () && keyMeta.hdKeypath .size () > 0 ) {
@@ -674,7 +674,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
674
674
675
675
// Set inactive chains
676
676
if (!hd_chains.empty ()) {
677
- LegacyScriptPubKeyMan * legacy_spkm = pwallet->GetLegacyScriptPubKeyMan ();
677
+ LegacyDataSPKM * legacy_spkm = pwallet->GetLegacyDataSPKM ();
678
678
if (legacy_spkm) {
679
679
for (const auto & [hd_seed_id, chain] : hd_chains) {
680
680
if (hd_seed_id != legacy_spkm->GetHDChain ().seed_id ) {
@@ -695,7 +695,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
695
695
uint8_t fYes ;
696
696
value >> fYes ;
697
697
if (fYes == ' 1' ) {
698
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadWatchOnly (script);
698
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadWatchOnly (script);
699
699
}
700
700
return DBErrors::LOAD_OK;
701
701
});
@@ -708,7 +708,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
708
708
key >> script;
709
709
CKeyMetadata keyMeta;
710
710
value >> keyMeta;
711
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadScriptMetadata (CScriptID (script), keyMeta);
711
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadScriptMetadata (CScriptID (script), keyMeta);
712
712
return DBErrors::LOAD_OK;
713
713
});
714
714
result = std::max (result, watch_meta_res.m_result );
@@ -720,7 +720,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
720
720
key >> nIndex;
721
721
CKeyPool keypool;
722
722
value >> keypool;
723
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadKeyPool (nIndex, keypool);
723
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadKeyPool (nIndex, keypool);
724
724
return DBErrors::LOAD_OK;
725
725
});
726
726
result = std::max (result, pool_res.m_result );
@@ -763,7 +763,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
763
763
764
764
// nTimeFirstKey is only reliable if all keys have metadata
765
765
if (pwallet->IsLegacy () && (key_res.m_records + ckey_res.m_records + watch_script_res.m_records ) != (keymeta_res.m_records + watch_meta_res.m_records )) {
766
- auto spk_man = pwallet->GetOrCreateLegacyScriptPubKeyMan ();
766
+ auto spk_man = pwallet->GetLegacyScriptPubKeyMan ();
767
767
if (spk_man) {
768
768
LOCK (spk_man->cs_KeyStore );
769
769
spk_man->UpdateTimeFirstKey (1 );
0 commit comments