@@ -352,7 +352,7 @@ bool LoadKey(CWallet* pwallet, DataStream& ssKey, DataStream& ssValue, std::stri
352
352
strErr = " Error reading wallet database: CPrivKey corrupt" ;
353
353
return false ;
354
354
}
355
- if (!pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadKey (key, vchPubKey))
355
+ if (!pwallet->GetOrCreateLegacyDataSPKM ()->LoadKey (key, vchPubKey))
356
356
{
357
357
strErr = " Error reading wallet database: LegacyScriptPubKeyMan::LoadKey failed" ;
358
358
return false ;
@@ -391,7 +391,7 @@ bool LoadCryptedKey(CWallet* pwallet, DataStream& ssKey, DataStream& ssValue, st
391
391
}
392
392
}
393
393
394
- if (!pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadCryptedKey (vchPubKey, vchPrivKey, checksum_valid))
394
+ if (!pwallet->GetOrCreateLegacyDataSPKM ()->LoadCryptedKey (vchPubKey, vchPrivKey, checksum_valid))
395
395
{
396
396
strErr = " Error reading wallet database: LegacyScriptPubKeyMan::LoadCryptedKey failed" ;
397
397
return false ;
@@ -438,7 +438,7 @@ bool LoadHDChain(CWallet* pwallet, DataStream& ssValue, std::string& strErr)
438
438
try {
439
439
CHDChain chain;
440
440
ssValue >> chain;
441
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadHDChain (chain);
441
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadHDChain (chain);
442
442
} catch (const std::exception & e) {
443
443
if (strErr.empty ()) {
444
444
strErr = e.what ();
@@ -582,7 +582,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
582
582
key >> hash;
583
583
CScript script;
584
584
value >> script;
585
- if (!pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadCScript (script))
585
+ if (!pwallet->GetOrCreateLegacyDataSPKM ()->LoadCScript (script))
586
586
{
587
587
strErr = " Error reading wallet database: LegacyScriptPubKeyMan::LoadCScript failed" ;
588
588
return DBErrors::NONCRITICAL_ERROR;
@@ -605,7 +605,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
605
605
key >> vchPubKey;
606
606
CKeyMetadata keyMeta;
607
607
value >> keyMeta;
608
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadKeyMetadata (vchPubKey.GetID (), keyMeta);
608
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadKeyMetadata (vchPubKey.GetID (), keyMeta);
609
609
610
610
// Extract some CHDChain info from this metadata if it has any
611
611
if (keyMeta.nVersion >= CKeyMetadata::VERSION_WITH_HDDATA && !keyMeta.hd_seed_id .IsNull () && keyMeta.hdKeypath .size () > 0 ) {
@@ -672,7 +672,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
672
672
673
673
// Set inactive chains
674
674
if (!hd_chains.empty ()) {
675
- LegacyScriptPubKeyMan * legacy_spkm = pwallet->GetLegacyScriptPubKeyMan ();
675
+ LegacyDataSPKM * legacy_spkm = pwallet->GetLegacyDataSPKM ();
676
676
if (legacy_spkm) {
677
677
for (const auto & [hd_seed_id, chain] : hd_chains) {
678
678
if (hd_seed_id != legacy_spkm->GetHDChain ().seed_id ) {
@@ -693,7 +693,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
693
693
uint8_t fYes ;
694
694
value >> fYes ;
695
695
if (fYes == ' 1' ) {
696
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadWatchOnly (script);
696
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadWatchOnly (script);
697
697
}
698
698
return DBErrors::LOAD_OK;
699
699
});
@@ -706,7 +706,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
706
706
key >> script;
707
707
CKeyMetadata keyMeta;
708
708
value >> keyMeta;
709
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadScriptMetadata (CScriptID (script), keyMeta);
709
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadScriptMetadata (CScriptID (script), keyMeta);
710
710
return DBErrors::LOAD_OK;
711
711
});
712
712
result = std::max (result, watch_meta_res.m_result );
@@ -718,7 +718,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
718
718
key >> nIndex;
719
719
CKeyPool keypool;
720
720
value >> keypool;
721
- pwallet->GetOrCreateLegacyScriptPubKeyMan ()->LoadKeyPool (nIndex, keypool);
721
+ pwallet->GetOrCreateLegacyDataSPKM ()->LoadKeyPool (nIndex, keypool);
722
722
return DBErrors::LOAD_OK;
723
723
});
724
724
result = std::max (result, pool_res.m_result );
@@ -761,7 +761,7 @@ static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch,
761
761
762
762
// nTimeFirstKey is only reliable if all keys have metadata
763
763
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 )) {
764
- auto spk_man = pwallet->GetOrCreateLegacyScriptPubKeyMan ();
764
+ auto spk_man = pwallet->GetLegacyScriptPubKeyMan ();
765
765
if (spk_man) {
766
766
LOCK (spk_man->cs_KeyStore );
767
767
spk_man->UpdateTimeFirstKey (1 );
0 commit comments