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

Do not ask for the first hash if GlobalTasks #495

Closed
wants to merge 2 commits into from

Conversation

vncoelho
Copy link
Member

@erikzhang,
There was no verification for the first hash.

I included this else:

                if (!globalTasks.Contains(hash))
                    session.RemoteNode.Tell(Message.Create("getblocks", GetBlocksPayload.Create(hash)));
                else
                    Console.WriteLine("Wrong behavior. Asking for a hash contained in global task");

And the message appeared.

@@ -234,7 +234,8 @@ private void RequestTasks(TaskSession session)
break;
}
}
session.RemoteNode.Tell(Message.Create("getblocks", GetBlocksPayload.Create(hash)));
if (!globalTasks.ContainsKey(hash))
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm if the hash is in globalTasks it could be getting data for the block, but this is asking for inventory and since this doesn’t give hash stop it will potentially get newer block inventory, so this could still be useful to leave the way it is actually.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is desirable behavior to have it learn about newest blocks from whichever is the latest on, so I think you could close this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like you are right again, @jsolman.

It kind of always reply with 500 blocks (which is not desirable from my perspective).
In this sense, I still think that the plausible possibility I thought was to ask for blocks in windows ( as I proposed in a previous PR, with a loop #486).

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