mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Use reconsider blocks for IX instead of disconnect
This commit is contained in:
parent
8168b60301
commit
fa9a0ec037
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user