Dont fetch ahead if cbopret chain, yes it will slow it down
This commit is contained in:
@@ -512,6 +512,8 @@ namespace {
|
|||||||
// Never fetch further than the best block we know the peer has, or more than BLOCK_DOWNLOAD_WINDOW + 1 beyond the last
|
// Never fetch further than the best block we know the peer has, or more than BLOCK_DOWNLOAD_WINDOW + 1 beyond the last
|
||||||
// linked block we have in common with this peer. The +1 is so we can detect stalling, namely if we would be able to
|
// linked block we have in common with this peer. The +1 is so we can detect stalling, namely if we would be able to
|
||||||
// download that next block if the window were 1 larger.
|
// download that next block if the window were 1 larger.
|
||||||
|
if ( ASSETCHAINS_CBOPRET != 0 )
|
||||||
|
BLOCK_DOWNLOAD_WINDOW = 1;
|
||||||
int nWindowEnd = state->pindexLastCommonBlock->GetHeight() + BLOCK_DOWNLOAD_WINDOW;
|
int nWindowEnd = state->pindexLastCommonBlock->GetHeight() + BLOCK_DOWNLOAD_WINDOW;
|
||||||
int nMaxHeight = std::min<int>(state->pindexBestKnownBlock->GetHeight(), nWindowEnd + 1);
|
int nMaxHeight = std::min<int>(state->pindexBestKnownBlock->GetHeight(), nWindowEnd + 1);
|
||||||
NodeId waitingfor = -1;
|
NodeId waitingfor = -1;
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ static const unsigned int MAX_HEADERS_RESULTS = 160;
|
|||||||
* Larger windows tolerate larger download speed differences between peer, but increase the potential
|
* Larger windows tolerate larger download speed differences between peer, but increase the potential
|
||||||
* degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning
|
* degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning
|
||||||
* harder). We'll probably want to make this a per-peer adaptive value at some point. */
|
* harder). We'll probably want to make this a per-peer adaptive value at some point. */
|
||||||
static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024;
|
static unsigned int BLOCK_DOWNLOAD_WINDOW = 1024;
|
||||||
/** Time to wait (in seconds) between writing blocks/block index to disk. */
|
/** Time to wait (in seconds) between writing blocks/block index to disk. */
|
||||||
static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60;
|
static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60;
|
||||||
/** Time to wait (in seconds) between flushing chainstate to disk. */
|
/** Time to wait (in seconds) between flushing chainstate to disk. */
|
||||||
|
|||||||
Reference in New Issue
Block a user