message: wallet: filter for keys only before record deser in salvage
  When salvaging a wallet, avoid deserializing any records that we don't
  care about, i.e. filter for keys only before the deserialization.
diff: @@ -16,6 +16,11 @@ static const char *HEADER_END = "HEADER=END";
  static const char *DATA_END = "DATA=END";
  typedef std::pair<std::vector<unsigned char>, std::vector<unsigned char> > KeyValPair;
  +static bool KeyFilter(const std::string& type)
  +{
  + return WalletBatch::IsKeyType(type) || type == DBKeys::HDCHAIN;
  +}
  +
  bool RecoverDatabaseFile(const fs::path& file_path, bilingual_str& error, std::vector<bilingual_str>& warnings)
  {
  std::string filename;
  @@ -129,9 +134,9 @@ bool RecoverDatabaseFile(const fs::path& file_path, bilingual_str& error, std::v
  {
  // Required in LoadKeyMetadata():
  LOCK(dummyWallet.cs_wallet);
  - fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue, strType, strErr);
  + fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue, strType, strErr, KeyFilter);
  }
  - if (!WalletBatch::IsKeyType(strType) && strType != DBKeys::HDCHAIN) {
  + if (!KeyFilter(strType)) {
  continue;
  }
  if (!fReadOK)
  