Use reconsider blocks for IX instead of disconnect

This commit is contained in:
Evan Duffield 2015-07-31 11:53:40 -07:00
parent 8168b60301
commit fa9a0ec037
3 changed files with 5 additions and 7 deletions

View File

@ -114,8 +114,8 @@ void ProcessMessageInstantX(CNode* pfrom, std::string& strCommand, CDataStream&
if(!CheckForConflictingLocks(tx)){
LogPrintf("ProcessMessageInstantX::ix - Found Existing Complete IX Lock\n");
CValidationState state;
DisconnectBlockAndInputs(state, tx);
//reprocess the last 15 blocks
ExecuteSpork(SPORK_12_RECONSIDER_BLOCKS, 15);
mapTxLockReq.insert(make_pair(tx.GetHash(), tx));
}
}
@ -385,8 +385,8 @@ bool ProcessConsensusVote(CConsensusVote& ctx)
//if this tx lock was rejected, we need to remove the conflicting blocks
if(mapTxLockReqRejected.count((*i).second.txHash)){
CValidationState state;
DisconnectBlockAndInputs(state, mapTxLockReqRejected[(*i).second.txHash]);
//reprocess the last 15 blocks
ExecuteSpork(SPORK_12_RECONSIDER_BLOCKS, 15);
}
}
}

View File

@ -11,6 +11,7 @@
#include "util.h"
#include "base58.h"
#include "main.h"
#include "spork.h"
/*
At 15 signatures, 1/2 of the masternode network can be owned by

View File

@ -399,9 +399,6 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex);
* of problems. Note that in any case, coins may be modified. */
bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool* pfClean = NULL);
/** Find a conflicting transcation in a block and disconnect all up to that point **/
bool DisconnectBlockAndInputs(CValidationState &state, CTransaction txLock);
/** Reprocess a number of blocks to try and get on the correct chain again **/
bool DisconnectBlocksAndReprocess(int blocks);