mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +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)){
|
if(!CheckForConflictingLocks(tx)){
|
||||||
LogPrintf("ProcessMessageInstantX::ix - Found Existing Complete IX Lock\n");
|
LogPrintf("ProcessMessageInstantX::ix - Found Existing Complete IX Lock\n");
|
||||||
|
|
||||||
CValidationState state;
|
//reprocess the last 15 blocks
|
||||||
DisconnectBlockAndInputs(state, tx);
|
ExecuteSpork(SPORK_12_RECONSIDER_BLOCKS, 15);
|
||||||
mapTxLockReq.insert(make_pair(tx.GetHash(), tx));
|
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 this tx lock was rejected, we need to remove the conflicting blocks
|
||||||
if(mapTxLockReqRejected.count((*i).second.txHash)){
|
if(mapTxLockReqRejected.count((*i).second.txHash)){
|
||||||
CValidationState state;
|
//reprocess the last 15 blocks
|
||||||
DisconnectBlockAndInputs(state, mapTxLockReqRejected[(*i).second.txHash]);
|
ExecuteSpork(SPORK_12_RECONSIDER_BLOCKS, 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "spork.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
At 15 signatures, 1/2 of the masternode network can be owned by
|
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. */
|
* of problems. Note that in any case, coins may be modified. */
|
||||||
bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool* pfClean = NULL);
|
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 **/
|
/** Reprocess a number of blocks to try and get on the correct chain again **/
|
||||||
bool DisconnectBlocksAndReprocess(int blocks);
|
bool DisconnectBlocksAndReprocess(int blocks);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user