Browse Source

Ignore decoding errors during -zapwallettxes

The undecoded wallet transaction is logged before proceeding, so later
recovery of metadata might be possible. But the fact that the user is
using -zapwallettxes is a clear indicator that they want
transactions removed from their wallet, so this is the priority.
metaverse
Jack Grigg 6 years ago
parent
commit
5513faccf6
No known key found for this signature in database GPG Key ID: 1B8D649257DB0829
  1. 15
      src/wallet/walletdb.cpp

15
src/wallet/walletdb.cpp

@ -1015,11 +1015,20 @@ DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector<uint256>& vTxHash, vec
uint256 hash;
ssKey >> hash;
CWalletTx wtx;
ssValue >> wtx;
std::vector<unsigned char> txData(ssValue.begin(), ssValue.end());
try {
CWalletTx wtx;
ssValue >> wtx;
vWtx.push_back(wtx);
} catch (...) {
// Decode failure likely due to Sapling v4 transaction format change
// between 2.0.0 and 2.0.1. As user is requesting deletion, log the
// transaction entry and then mark it for deletion anyway.
LogPrintf("Failed to decode wallet transaction; logging it here before deletion:\n");
LogPrintf("txid: %s\n%s\n", hash.GetHex(), HexStr(txData));
}
vTxHash.push_back(hash);
vWtx.push_back(wtx);
}
}
pcursor->close();

Loading…
Cancel
Save