We do not support coin imports
This commit is contained in:
@@ -557,8 +557,6 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr
|
|||||||
CAmount value,nResult = 0;
|
CAmount value,nResult = 0;
|
||||||
if ( interestp != 0 )
|
if ( interestp != 0 )
|
||||||
*interestp = 0;
|
*interestp = 0;
|
||||||
//if ( tx.IsCoinImport() )
|
|
||||||
// return GetCoinImportValue(tx);
|
|
||||||
if ( tx.IsCoinBase() != 0 )
|
if ( tx.IsCoinBase() != 0 )
|
||||||
return 0;
|
return 0;
|
||||||
for (unsigned int i = 0; i < tx.vin.size(); i++)
|
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.
|
// use the maximum priority for all (partially or fully) shielded transactions.
|
||||||
// (Note that coinbase transactions cannot contain Sapling shielded Spends or Outputs.)
|
// (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;
|
return MAX_PRIORITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
36
src/main.cpp
36
src/main.cpp
@@ -817,7 +817,7 @@ bool hush_dailysnapshot(int32_t height)
|
|||||||
{
|
{
|
||||||
uint256 blockhash; CTransaction txin;
|
uint256 blockhash; CTransaction txin;
|
||||||
//if (tx.IsPegsImport() && j==0) continue;
|
//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;
|
int vout = tx.vin[j].prevout.n;
|
||||||
if ( ExtractDestination(txin.vout[vout].scriptPubKey, vDest) )
|
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)
|
unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& inputs)
|
||||||
{
|
{
|
||||||
if (tx.IsCoinBase() || tx.IsCoinImport())
|
if (tx.IsCoinBase())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
unsigned int nSigOps = 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
|
// Keep track of transactions that spend a coinbase, which we re-scan
|
||||||
// during reorgs to ensure COINBASE_MATURITY is still met.
|
// during reorgs to ensure COINBASE_MATURITY is still met.
|
||||||
bool fSpendsCoinbase = false;
|
bool fSpendsCoinbase = false;
|
||||||
if (!tx.IsCoinImport()) { // && !tx.IsPegsImport()) {
|
BOOST_FOREACH(const CTxIn &txin, tx.vin) {
|
||||||
BOOST_FOREACH(const CTxIn &txin, tx.vin) {
|
const CCoins *coins = view.AccessCoins(txin.prevout.hash);
|
||||||
const CCoins *coins = view.AccessCoins(txin.prevout.hash);
|
if (coins->IsCoinBase()) {
|
||||||
if (coins->IsCoinBase()) {
|
fSpendsCoinbase = true;
|
||||||
fSpendsCoinbase = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Grab the branch ID we expect this transaction to commit to. We don't
|
// 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
|
// Continuously rate-limit free (really, very-low-fee) transactions
|
||||||
// This mitigates 'penny-flooding' -- sending thousands of free transactions just to
|
// This mitigates 'penny-flooding' -- sending thousands of free transactions just to
|
||||||
// be annoying or make others' transactions take longer to confirm.
|
// 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 CCriticalSection csFreeLimiter;
|
||||||
static double dFreeCount;
|
static double dFreeCount;
|
||||||
@@ -1998,17 +1996,15 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
LOCK(pool.cs);
|
LOCK(pool.cs);
|
||||||
// Store transaction in memory
|
// Store transaction in memory
|
||||||
pool.addUnchecked(hash, entry, !IsInitialBlockDownload());
|
pool.addUnchecked(hash, entry, !IsInitialBlockDownload());
|
||||||
if (!tx.IsCoinImport())
|
|
||||||
{
|
|
||||||
// Add memory address index
|
|
||||||
if (fAddressIndex) {
|
|
||||||
pool.addAddressIndex(entry, view);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add memory spent index
|
// Add memory address index
|
||||||
if (fSpentIndex) {
|
if (fAddressIndex) {
|
||||||
pool.addSpentIndex(entry, view);
|
pool.addAddressIndex(entry, view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add memory spent index
|
||||||
|
if (fSpentIndex) {
|
||||||
|
pool.addSpentIndex(entry, view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,13 +120,12 @@ bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry,
|
|||||||
const CTransaction& tx = mapTx.find(hash)->GetTx();
|
const CTransaction& tx = mapTx.find(hash)->GetTx();
|
||||||
mapRecentlyAddedTx[tx.GetHash()] = &tx;
|
mapRecentlyAddedTx[tx.GetHash()] = &tx;
|
||||||
nRecentlyAddedSequence += 1;
|
nRecentlyAddedSequence += 1;
|
||||||
if (!tx.IsCoinImport()) {
|
|
||||||
for (unsigned int i = 0; i < tx.vin.size(); i++)
|
for (unsigned int i = 0; i < tx.vin.size(); i++)
|
||||||
{
|
{
|
||||||
//if (tx.IsPegsImport() && i==0) continue;
|
mapNextTx[tx.vin[i].prevout] = CInPoint(&tx, i);
|
||||||
mapNextTx[tx.vin[i].prevout] = CInPoint(&tx, i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
|
for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
|
||||||
mapSaplingNullifiers[spendDescription.nullifier] = &tx;
|
mapSaplingNullifiers[spendDescription.nullifier] = &tx;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user