Skip to content

Commit

Permalink
ATMP: Do not try to get the inputs in zc tx.
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Jul 3, 2020
1 parent 38efbb9 commit 6cf9778
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -998,17 +998,18 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState& state, const CTransa
CAmount nFees = nValueIn - nValueOut;
CAmount inChainInputValue = 0;
double dPriority = 0;
if (!hasZcSpendInputs)
bool fSpendsCoinbaseOrCoinstake = false;
if (!hasZcSpendInputs) {
dPriority = view.GetPriority(tx, chainHeight, inChainInputValue);

// Keep track of transactions that spend a coinbase, which we re-scan
// during reorgs to ensure COINBASE_MATURITY is still met.
bool fSpendsCoinbaseOrCoinstake = false;
for (const CTxIn &txin : tx.vin) {
const CCoins *coins = view.AccessCoins(txin.prevout.hash);
if (coins->IsCoinBase() || coins->IsCoinStake()) {
fSpendsCoinbaseOrCoinstake = true;
break;
// Keep track of transactions that spend a coinbase, which we re-scan
// during reorgs to ensure COINBASE_MATURITY is still met.
for (const CTxIn &txin : tx.vin) {
const CCoins *coins = view.AccessCoins(txin.prevout.hash);
if (coins->IsCoinBase() || coins->IsCoinStake()) {
fSpendsCoinbaseOrCoinstake = true;
break;
}
}
}

Expand Down

0 comments on commit 6cf9778

Please sign in to comment.