IsPegsImport() is always false

Since this function always returns false and is used in many "hot"
code paths, removing it from the code should give us a performance boost.
This commit is contained in:
Duke
2024-09-18 12:13:37 -04:00
parent ffce5edda3
commit d471af9ef5
3 changed files with 14 additions and 35 deletions

View File

@@ -123,7 +123,7 @@ bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry,
if (!tx.IsCoinImport()) {
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
if (tx.IsPegsImport() && i==0) continue;
//if (tx.IsPegsImport() && i==0) continue;
mapNextTx[tx.vin[i].prevout] = CInPoint(&tx, i);
}
}
@@ -146,7 +146,7 @@ void CTxMemPool::addAddressIndex(const CTxMemPoolEntry &entry, const CCoinsViewC
uint256 txhash = tx.GetHash();
for (unsigned int j = 0; j < tx.vin.size(); j++) {
if (tx.IsPegsImport() && j==0) continue;
//if (tx.IsPegsImport() && j==0) continue;
const CTxIn input = tx.vin[j];
const CTxOut &prevout = view.GetOutputFor(input);
@@ -252,7 +252,7 @@ void CTxMemPool::addSpentIndex(const CTxMemPoolEntry &entry, const CCoinsViewCac
uint256 txhash = tx.GetHash();
for (unsigned int j = 0; j < tx.vin.size(); j++) {
if (tx.IsPegsImport() && j==0) continue;
//if (tx.IsPegsImport() && j==0) continue;
const CTxIn input = tx.vin[j];
const CTxOut &prevout = view.GetOutputFor(input);