@@ -470,17 +470,13 @@ bool LoadHDChain(CWallet* pwallet, DataStream& ssValue, std::string& strErr)
470
470
471
471
static bool
472
472
ReadKeyValue (CWallet* pwallet, DataStream& ssKey, CDataStream& ssValue,
473
- CWalletScanState &wss, std::string& strType, std::string& strErr, const KeyFilterFn& filter_fn = nullptr ) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)
473
+ CWalletScanState &wss, std::string& strType, std::string& strErr) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)
474
474
{
475
475
try {
476
476
// Unserialize
477
477
// Taking advantage of the fact that pair serialization
478
478
// is just the two items serialized one after the other
479
479
ssKey >> strType;
480
- // If we have a filter, check if this matches the filter
481
- if (filter_fn && !filter_fn (strType)) {
482
- return true ;
483
- }
484
480
// Legacy entries in descriptor wallets are not allowed, abort immediately
485
481
if (pwallet->IsWalletFlagSet (WALLET_FLAG_DESCRIPTORS) && DBKeys::LEGACY_TYPES.count (strType) > 0 ) {
486
482
wss.unexpected_legacy_entry = true ;
@@ -834,19 +830,6 @@ ReadKeyValue(CWallet* pwallet, DataStream& ssKey, CDataStream& ssValue,
834
830
return true ;
835
831
}
836
832
837
- bool ReadKeyValue (CWallet* pwallet, DataStream& ssKey, CDataStream& ssValue, std::string& strType, std::string& strErr, const KeyFilterFn& filter_fn)
838
- {
839
- CWalletScanState dummy_wss;
840
- LOCK (pwallet->cs_wallet );
841
- return ReadKeyValue (pwallet, ssKey, ssValue, dummy_wss, strType, strErr, filter_fn);
842
- }
843
-
844
- bool WalletBatch::IsKeyType (const std::string& strType)
845
- {
846
- return (strType == DBKeys::KEY ||
847
- strType == DBKeys::MASTER_KEY || strType == DBKeys::CRYPTED_KEY);
848
- }
849
-
850
833
static DBErrors LoadMinVersion (CWallet* pwallet, DatabaseBatch& batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)
851
834
{
852
835
AssertLockHeld (pwallet->cs_wallet );
@@ -934,7 +917,10 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
934
917
}
935
918
// losing keys is considered a catastrophic error, anything else
936
919
// we assume the user can live with:
937
- if (IsKeyType (strType) || strType == DBKeys::DEFAULTKEY) {
920
+ if (strType == DBKeys::KEY ||
921
+ strType == DBKeys::MASTER_KEY ||
922
+ strType == DBKeys::CRYPTED_KEY ||
923
+ strType == DBKeys::DEFAULTKEY) {
938
924
result = DBErrors::CORRUPT;
939
925
} else if (wss.tx_corrupt ) {
940
926
pwallet->WalletLogPrintf (" Error: Corrupt transaction found. This can be fixed by removing transactions from wallet and rescanning.\n " );
0 commit comments