We do not support coin imports

This commit is contained in:
Duke
2024-09-24 09:35:20 -04:00
parent bd5f0103a8
commit 01f0c34661
3 changed files with 22 additions and 29 deletions

View File

@@ -557,8 +557,6 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr
CAmount value,nResult = 0;
if ( interestp != 0 )
*interestp = 0;
//if ( tx.IsCoinImport() )
// return GetCoinImportValue(tx);
if ( tx.IsCoinBase() != 0 )
return 0;
for (unsigned int i = 0; i < tx.vin.size(); i++)
@@ -616,7 +614,7 @@ double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const
// use the maximum priority for all (partially or fully) shielded transactions.
// (Note that coinbase transactions cannot contain Sapling shielded Spends or Outputs.)
if (tx.vShieldedSpend.size() > 0 || tx.vShieldedOutput.size() > 0 || tx.IsCoinImport() ) { // || tx.IsPegsImport()) {
if (tx.vShieldedSpend.size() > 0 || tx.vShieldedOutput.size() > 0 ) {
return MAX_PRIORITY;
}

View File

@@ -817,7 +817,7 @@ bool hush_dailysnapshot(int32_t height)
{
uint256 blockhash; CTransaction txin;
//if (tx.IsPegsImport() && j==0) continue;
if ( !tx.IsCoinImport() && !tx.IsCoinBase() && myGetTransaction(tx.vin[j].prevout.hash,txin,blockhash) )
if ( !tx.IsCoinBase() && myGetTransaction(tx.vin[j].prevout.hash,txin,blockhash) )
{
int vout = tx.vin[j].prevout.n;
if ( ExtractDestination(txin.vout[vout].scriptPubKey, vDest) )
@@ -1180,7 +1180,7 @@ unsigned int GetLegacySigOpCount(const CTransaction& tx)
unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& inputs)
{
if (tx.IsCoinBase() || tx.IsCoinImport())
if (tx.IsCoinBase())
return 0;
unsigned int nSigOps = 0;
@@ -1889,13 +1889,11 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
// Keep track of transactions that spend a coinbase, which we re-scan
// during reorgs to ensure COINBASE_MATURITY is still met.
bool fSpendsCoinbase = false;
if (!tx.IsCoinImport()) { // && !tx.IsPegsImport()) {
BOOST_FOREACH(const CTxIn &txin, tx.vin) {
const CCoins *coins = view.AccessCoins(txin.prevout.hash);
if (coins->IsCoinBase()) {
fSpendsCoinbase = true;
break;
}
BOOST_FOREACH(const CTxIn &txin, tx.vin) {
const CCoins *coins = view.AccessCoins(txin.prevout.hash);
if (coins->IsCoinBase()) {
fSpendsCoinbase = true;
break;
}
}
// Grab the branch ID we expect this transaction to commit to. We don't
@@ -1927,7 +1925,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
// Continuously rate-limit free (really, very-low-fee) transactions
// This mitigates 'penny-flooding' -- sending thousands of free transactions just to
// be annoying or make others' transactions take longer to confirm.
if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize) && !tx.IsCoinImport() )
if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize) )
{
static CCriticalSection csFreeLimiter;
static double dFreeCount;
@@ -1998,17 +1996,15 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
LOCK(pool.cs);
// Store transaction in memory
pool.addUnchecked(hash, entry, !IsInitialBlockDownload());
if (!tx.IsCoinImport())
{
// Add memory address index
if (fAddressIndex) {
pool.addAddressIndex(entry, view);
}
// Add memory spent index
if (fSpentIndex) {
pool.addSpentIndex(entry, view);
}
// Add memory address index
if (fAddressIndex) {
pool.addAddressIndex(entry, view);
}
// Add memory spent index
if (fSpentIndex) {
pool.addSpentIndex(entry, view);
}
}
}

View File

@@ -120,13 +120,12 @@ bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry,
const CTransaction& tx = mapTx.find(hash)->GetTx();
mapRecentlyAddedTx[tx.GetHash()] = &tx;
nRecentlyAddedSequence += 1;
if (!tx.IsCoinImport()) {
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
//if (tx.IsPegsImport() && i==0) continue;
mapNextTx[tx.vin[i].prevout] = CInPoint(&tx, i);
}
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
mapNextTx[tx.vin[i].prevout] = CInPoint(&tx, i);
}
for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
mapSaplingNullifiers[spendDescription.nullifier] = &tx;
}