Better cheat catcher
This commit is contained in:
@@ -303,14 +303,6 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount,
|
||||
tb.AddOpRet(mtx.vout[mtx.vout.size() - 1].scriptPubKey);
|
||||
|
||||
cheatSpend = tb.Build();
|
||||
if (cheatSpend)
|
||||
{
|
||||
cheatTx = boost::get<CTransaction>(cheatSpend);
|
||||
unsigned int nTxSize = ::GetSerializeSize(cheatTx, SER_NETWORK, PROTOCOL_VERSION);
|
||||
double dPriority = cheatTx.ComputePriority(dPriority, nTxSize);
|
||||
CFeeRate feeRate(DEFAULT_TRANSACTION_MAXFEE, nTxSize);
|
||||
vecPriority.push_back(TxPriority(dPriority, feeRate, &cheatTx));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,9 +313,15 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount,
|
||||
if (cheatSpend)
|
||||
{
|
||||
std::list<CTransaction> removed;
|
||||
mempool.removeConflicts(cheatSpend.value(), removed);
|
||||
mempool.removeConflicts(cheatTx, removed);
|
||||
printf("Found cheating stake! Adding cheat spend for %.8f at block #%d, coinbase tx\n%s\n",
|
||||
(double)cb.GetValueOut() / (double)COIN, nHeight, cheatSpend.value().vin[0].prevout.hash.GetHex().c_str());
|
||||
|
||||
// add to mem pool and relay
|
||||
if (myAddtomempool(cheatTx))
|
||||
{
|
||||
RelayTransaction(cheatTx);
|
||||
}
|
||||
}
|
||||
|
||||
// now add transactions from the mem pool
|
||||
|
||||
Reference in New Issue
Block a user