Log txid for double spends and missing anchors
This makes debugging failed transactions much easier.
This commit is contained in:
@@ -578,13 +578,13 @@ bool CCoinsViewCache::HaveShieldedRequirements(const CTransaction& tx) const
|
|||||||
{
|
{
|
||||||
for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
|
for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
|
||||||
if (GetNullifier(spendDescription.nullifier, SAPLING)) { // Prevent double spends
|
if (GetNullifier(spendDescription.nullifier, SAPLING)) { // Prevent double spends
|
||||||
LogPrintf("%s: sapling nullifier %s exists, preventing double spend\n", __FUNCTION__, spendDescription.nullifier.GetHex().c_str());
|
LogPrintf("%s: sapling nullifier %s exists, preventing double spend in tx %s\n", __FUNCTION__, spendDescription.nullifier.GetHex().c_str(), tx.GetHash().GetHex().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SaplingMerkleTree tree;
|
SaplingMerkleTree tree;
|
||||||
if (!GetSaplingAnchorAt(spendDescription.anchor, tree)) {
|
if (!GetSaplingAnchorAt(spendDescription.anchor, tree)) {
|
||||||
LogPrintf("%s: missing sapling anchor: %s \n", __FUNCTION__, spendDescription.anchor.GetHex().c_str());
|
LogPrintf("%s: missing sapling anchor: %s in tx %s \n", __FUNCTION__, spendDescription.anchor.GetHex().c_str(), tx.GetHash().GetHex().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user