removed tx lock mempool checks / added debugging for disconnects

This commit is contained in:
Evan Duffield 2014-11-29 10:04:16 -07:00
parent f244d1475f
commit e7e57d7917

View File

@ -711,24 +711,6 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
return false;
}
// See if this conflicts with any TX locks
//printf("mapTxLocks start\n");
typedef std::map<uint256, CTransactionLock>::iterator it_ctxl;
for(it_ctxl it = mapTxLocks.begin(); it != mapTxLocks.end(); it++) {
//printf("%s\n", it->second.tx.ToString().c_str());
//printf("%s\n", tx.ToString().c_str());
for (unsigned int a = 0; a < it->second.tx.vin.size(); a++) {
for (unsigned int b = 0; b < tx.vin.size(); b++) {
//printf(" compare %d - %d\n", a, b);
if(tx.vin[b].prevout == it->second.tx.vin[a].prevout) {
return error("CTxMemPool::acceptableInputs()::InstantX : invalid transaction, conflicts with existing transaction lock %s", tx.vin[b].ToString().c_str());
}
}
}
}
//printf("mapTxLocks end\n");
// Check for conflicts with in-memory transactions
CTransaction* ptxOld = NULL;
for (unsigned int i = 0; i < tx.vin.size(); i++)
@ -877,18 +859,6 @@ bool CTxMemPool::acceptableInputs(CValidationState &state, CTransaction &tx, boo
strNonStd.c_str());
*/
// See if this conflicts with any TX locks
typedef std::map<uint256, CTransactionLock>::iterator it_ctxl;
for(it_ctxl it = mapTxLocks.begin(); it != mapTxLocks.end(); it++) {
for (unsigned int a = 0; a < it->second.tx.vin.size(); a++) {
for (unsigned int b = 0; b < tx.vin.size(); b++) {
if(tx.vin[b].prevout == it->second.tx.vin[a].prevout) {
return error("CTxMemPool::acceptableInputs()::InstantX : invalid transaction, conflicts with existing transaction lock %s", tx.vin[b].ToString().c_str());
}
}
}
}
// Check for conflicts with in-memory transactions
for (unsigned int i = 0; i < tx.vin.size(); i++)
@ -2523,6 +2493,9 @@ bool DisconnectBlockAndInputs(CValidationState &state, std::vector<CTxIn> vecInp
if (vDisconnect.size() > 0) {
LogPrintf("REORGANIZE: Disconnect Conflicting Blocks %"PRIszu" blocks; %s..\n", vDisconnect.size(), pindexNew->GetBlockHash().ToString().c_str());
BOOST_FOREACH(CBlockIndex* pindex, vDisconnect) {
LogPrintf(" -- disconnect %s\n", pindex->GetBlockHash().ToString().c_str());
}
}
// Disconnect shorter branch