Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove msMiningErrorsIncluded & msMiningErrorsExcluded #2215

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ bool bGridcoinCoreInitComplete = false;

// Mining status variables
std::string msMiningErrors;
std::string msMiningErrorsIncluded;
std::string msMiningErrorsExcluded;

//When syncing, we grandfather block rejection rules up to this block, as rules became stricter over time and fields changed
int nGrandfather = 1034700;
Expand Down
2 changes: 0 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ extern bool fEnforceCanonical;
static const uint64_t nMinDiskSpace = 52428800;

extern std::string msMiningErrors;
extern std::string msMiningErrorsIncluded;
extern std::string msMiningErrorsExcluded;

extern int nGrandfather;

Expand Down
20 changes: 0 additions & 20 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ bool CreateRestOfTheBlock(CBlock &block, CBlockIndex* pindexPrev)
vOrphan.push_back(COrphan(&tx));
porphan = &vOrphan.back();
LogPrint(BCLog::LogFlags::NOISY, "Orphan tx %s ",tx.GetHash().GetHex());
msMiningErrorsExcluded += tx.GetHash().GetHex() + ":ORPHAN;";
}
mapDependers[txin.prevout.hash].push_back(porphan);
porphan->setDependsOn.insert(txin.prevout.hash);
Expand Down Expand Up @@ -343,28 +342,19 @@ bool CreateRestOfTheBlock(CBlock &block, CBlockIndex* pindexPrev)
if (nBlockSize + nTxSize >= nBlockMaxSize)
{
LogPrintf("Tx size too large for tx %s blksize %" PRIu64 ", tx size %" PRId64, tx.GetHash().GetHex(), nBlockSize, nTxSize);
msMiningErrorsExcluded += tx.GetHash().GetHex() + ":SizeTooLarge("
+ ToString(nBlockSize) + "," + ToString(nTxSize) + ")("
+ ToString(nBlockSize) + ");";

continue;
}

// Legacy limits on sigOps:
unsigned int nTxSigOps = GetLegacySigOpCount(tx);
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
{
msMiningErrorsExcluded += tx.GetHash().GetHex() + ":LegacySigOpLimit(" +
ToString(nBlockSigOps) + "," + ToString(nTxSigOps) + ")("
+ ToString(MAX_BLOCK_SIGOPS) + ");";
continue;
}

// Timestamp limit
if (tx.nTime > block.nTime)
{
msMiningErrorsExcluded += tx.GetHash().GetHex() + ":TimestampLimit(" + ToString(tx.nTime) + ","
+ ToString(block.vtx[0].nTime) + ");";
continue;
}

Expand Down Expand Up @@ -393,7 +383,6 @@ bool CreateRestOfTheBlock(CBlock &block, CBlockIndex* pindexPrev)
if (!FetchInputs(tx, txdb, mapTestPoolTmp, false, true, mapInputs, fInvalid))
{
LogPrint(BCLog::LogFlags::NOISY, "Unable to fetch inputs for tx %s ", tx.GetHash().GetHex());
msMiningErrorsExcluded += tx.GetHash().GetHex() + ":UnableToFetchInputs;";
continue;
}

Expand All @@ -403,8 +392,6 @@ bool CreateRestOfTheBlock(CBlock &block, CBlockIndex* pindexPrev)
LogPrint(BCLog::LogFlags::NOISY,
"Not including tx %s due to TxFees of %" PRId64 ", bare min fee is %" PRId64,
tx.GetHash().GetHex(), nTxFees, nMinFee);
msMiningErrorsExcluded += tx.GetHash().GetHex() + ":FeeTooSmall("
+ RoundToString(CoinToDouble(nFees),8) + "," +RoundToString(CoinToDouble(nMinFee),8) + ");";
continue;
}

Expand All @@ -413,24 +400,17 @@ bool CreateRestOfTheBlock(CBlock &block, CBlockIndex* pindexPrev)
{
LogPrint(BCLog::LogFlags::NOISY, "Not including tx %s due to exceeding max sigops of %d, sigops is %d",
tx.GetHash().GetHex(), (nBlockSigOps+nTxSigOps), MAX_BLOCK_SIGOPS);
msMiningErrorsExcluded += tx.GetHash().GetHex() + ":ExceededSigOps("
+ ToString(nBlockSigOps) + "," + ToString(nTxSigOps) + ")("
+ ToString(MAX_BLOCK_SIGOPS) + ");";

continue;
}

if (!ConnectInputs(tx, txdb, mapInputs, mapTestPoolTmp, CDiskTxPos(1,1,1), pindexPrev, false, true))
{
LogPrint(BCLog::LogFlags::NOISY, "Unable to connect inputs for tx %s ",tx.GetHash().GetHex());
msMiningErrorsExcluded += tx.GetHash().GetHex() + ":UnableToConnectInputs();";
continue;
}
mapTestPoolTmp[tx.GetHash()] = CTxIndex(CDiskTxPos(1,1,1), tx.vout.size());
swap(mapTestPool, mapTestPoolTmp);

// Added
msMiningErrorsIncluded += tx.GetHash().GetHex() + ";";
block.vtx.push_back(tx);
nBlockSize += nTxSize;
++nBlockTx;
Expand Down
2 changes: 0 additions & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,6 @@ bool ConnectInputs(CTransaction& tx, CTxDB& txdb, MapPrevTx inputs, std::map<uin
{
if (fMiner)
{
msMiningErrorsExcluded += " ConnectInputs() : " + tx.GetHash().GetHex() + " used at "
+ txindex.vSpent[prevout.n].ToString() + "; ";
return false;
}
if (!txindex.vSpent[prevout.n].IsNull())
Expand Down