From fa9a0ec03796ab65615334b04a3339e15bffe350 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Fri, 31 Jul 2015 11:53:40 -0700 Subject: [PATCH] Use reconsider blocks for IX instead of disconnect --- src/instantx.cpp | 8 ++++---- src/instantx.h | 1 + src/main.h | 3 --- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/instantx.cpp b/src/instantx.cpp index 588a391468..d0ac72840c 100644 --- a/src/instantx.cpp +++ b/src/instantx.cpp @@ -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); } } } diff --git a/src/instantx.h b/src/instantx.h index 0490e02523..ceb5fc6ce3 100644 --- a/src/instantx.h +++ b/src/instantx.h @@ -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 diff --git a/src/main.h b/src/main.h index 02cceca162..9b45efe6e8 100644 --- a/src/main.h +++ b/src/main.h @@ -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);