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.
This commit is contained in:
parent
cb9cff5fdc
commit
5513faccf6
|
@ -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…
Reference in New Issue