Commit da70f8be authored by barrystyle's avatar barrystyle

massively improve sync speed

parent db79ad7d
...@@ -2789,7 +2789,7 @@ bool ActivateBestChain(CValidationState& state, CBlock* pblock, bool fAlreadyChe ...@@ -2789,7 +2789,7 @@ bool ActivateBestChain(CValidationState& state, CBlock* pblock, bool fAlreadyChe
uiInterface.NotifyBlockTip(hashNewTip); uiInterface.NotifyBlockTip(hashNewTip);
} }
} while (pindexMostWork != chainActive.Tip()); } while (pindexMostWork != chainActive.Tip());
CheckBlockIndex(); // CheckBlockIndex();
// Write changes periodically to disk, after relay. // Write changes periodically to disk, after relay.
if (!FlushStateToDisk(state, FLUSH_STATE_PERIODIC)) { if (!FlushStateToDisk(state, FLUSH_STATE_PERIODIC)) {
...@@ -3600,7 +3600,7 @@ bool ProcessNewBlock(CValidationState& state, CNode* pfrom, CBlock* pblock, CDis ...@@ -3600,7 +3600,7 @@ bool ProcessNewBlock(CValidationState& state, CNode* pfrom, CBlock* pblock, CDis
if (pindex && pfrom) { if (pindex && pfrom) {
mapBlockSource[pindex->GetBlockHash ()] = pfrom->GetId (); mapBlockSource[pindex->GetBlockHash ()] = pfrom->GetId ();
} }
CheckBlockIndex (); // CheckBlockIndex ();
if (!ret) if (!ret)
return error ("%s : AcceptBlock FAILED", __func__); return error ("%s : AcceptBlock FAILED", __func__);
} }
......
...@@ -88,7 +88,7 @@ static const int MAX_SCRIPTCHECK_THREADS = 16; ...@@ -88,7 +88,7 @@ static const int MAX_SCRIPTCHECK_THREADS = 16;
/** -par default (number of script-checking threads, 0 = auto) */ /** -par default (number of script-checking threads, 0 = auto) */
static const int DEFAULT_SCRIPTCHECK_THREADS = 0; static const int DEFAULT_SCRIPTCHECK_THREADS = 0;
/** Number of blocks that can be requested at any given time from a single peer. */ /** Number of blocks that can be requested at any given time from a single peer. */
static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 128; static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 256;
/** Timeout in seconds during which a peer must stall block download progress before being disconnected. */ /** Timeout in seconds during which a peer must stall block download progress before being disconnected. */
static const unsigned int BLOCK_STALLING_TIMEOUT = 2; static const unsigned int BLOCK_STALLING_TIMEOUT = 2;
/** Number of headers sent in one getheaders result. We rely on the assumption that if a peer sends /** Number of headers sent in one getheaders result. We rely on the assumption that if a peer sends
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment