Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

[BlockStore] ProcessPendingStorage should download and persist new blocks immediately #392 #396

Merged
merged 31 commits into from
Sep 4, 2017
Merged

[BlockStore] ProcessPendingStorage should download and persist new blocks immediately #392 #396

merged 31 commits into from
Sep 4, 2017

Conversation

fassadlr
Copy link
Collaborator

@fassadlr fassadlr commented Sep 1, 2017

No description provided.

…toreInnerStepFindBlocks can ask for multiple blocks #339

Commit before merge
…toreInnerStepFindBlocks can ask for multiple blocks #339 #361

Removed from ShouldStopFindingBlocks
…toreInnerStepFindBlocks can ask for multiple blocks #339

Fixes as per review

ChainedBlock lastFoundChainedBlock = nextChainedBlock;
//If pending storage has not yet reached the threshold or the node is in IDB, stop the loop and wait for more blocks.
if (this.BlockStoreLoop.PendingStorage.Count < BlockStoreLoop.PendingStorageBatchThreshold && this.BlockStoreLoop.ChainState.IsInitialBlockDownload == true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can swap this so first check for IBD, to avoid enumerating the list.
Also need to take the dispose property in to account(i.e. if in dispose more then just push).

if (context.PendingBlockPairsToStore.Any())
{
this.logger.LogTrace("[FLUSH_NEXTBLOCKNOTINPENDING]", nameof(context.PendingStorageBatchSize), context.PendingStorageBatchSize);
await PushBlocksToRepository(context);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add 'this.'

}

if ((pendingStorageBatchSize > BlockStoreLoop.MaxPendingInsertBlockSize) || breakExecution)
if (context.PendingStorageBatchSize > BlockStoreLoop.MaxPendingInsertBlockSize)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the 'dispose' propertry

@dangershony dangershony merged commit 765df23 into stratisproject:master Sep 4, 2017
@fassadlr fassadlr deleted the store-pendingstorage-newblock branch September 4, 2017 16:03
codingupastorm pushed a commit to codingupastorm/StratisBitcoinFullNode that referenced this pull request Jul 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants