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:
@@ -1015,11 +1015,20 @@ DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector<uint256>& vTxHash, vec
|
|||||||
uint256 hash;
|
uint256 hash;
|
||||||
ssKey >> hash;
|
ssKey >> hash;
|
||||||
|
|
||||||
CWalletTx wtx;
|
std::vector<unsigned char> txData(ssValue.begin(), ssValue.end());
|
||||||
ssValue >> wtx;
|
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);
|
vTxHash.push_back(hash);
|
||||||
vWtx.push_back(wtx);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pcursor->close();
|
pcursor->close();
|
||||||
|
|||||||
Reference in New Issue
Block a user