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

@@ -563,11 +563,6 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr
return 0;
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
//if (tx.IsPegsImport() && i==0)
//{
// nResult = GetCoinImportValue(tx);
// continue;
//}
value = GetOutputFor(tx.vin[i]).nValue;
nResult += value;
}
@@ -599,7 +594,7 @@ bool CCoinsViewCache::HaveInputs(const CTransaction& tx) const
{
if (!tx.IsMint()) {
for (unsigned int i = 0; i < tx.vin.size(); i++) {
if (tx.IsPegsImport() && i==0) continue;
//if (tx.IsPegsImport() && i==0) continue;
const COutPoint &prevout = tx.vin[i].prevout;
const CCoins* coins = AccessCoins(prevout.hash);
if (!coins || !coins->IsAvailable(prevout.n)) {
@@ -621,7 +616,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 || tx.IsCoinImport() ) { // || tx.IsPegsImport()) {
return MAX_PRIORITY;
}