Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe the first requested block hash is missing #494

Closed
wants to merge 1 commit into from

Conversation

vncoelho
Copy link
Member

@vncoelho vncoelho commented Nov 30, 2018

@erikzhang, @jsolman,
I am not sure, but I think that the first requested block hash was missing.

@vncoelho vncoelho changed the title Maybe the first request hash is missing Maybe the first requested hash is missing Nov 30, 2018
@vncoelho vncoelho changed the title Maybe the first requested hash is missing Maybe the first requested block hash is missing Nov 30, 2018
@vncoelho
Copy link
Member Author

If yes, let's also fix that for the headers request, @erikzhang.

@@ -156,7 +156,8 @@ private void OnGetBlocksMessageReceived(GetBlocksPayload payload)
BlockState state = Blockchain.Singleton.Store.GetBlocks().TryGet(hash);
if (state == null) return;
List<UInt256> hashes = new List<UInt256>();
for (uint i = 1; i <= InvPayload.MaxHashesCount; i++)
hashes.Add(hash);
Copy link
Contributor

@jsolman jsolman Nov 30, 2018

Choose a reason for hiding this comment

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

I think the code that requests always gives the hash before the one that it actually expects to get back first

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like you are right again, Jeff.
It starts with UInt256 hash = Blockchain.Singleton.CurrentBlockHash;

@vncoelho vncoelho closed this Dec 1, 2018
@vncoelho vncoelho deleted the first-hash-missing branch December 1, 2018 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants