MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.87k stars 846 forks source link

Allow restrict connections depending their height #968

Closed lontivero closed 3 years ago

lontivero commented 3 years ago

This PR is for allowing clients to restrict connections to nodes that are at a minimum height (they can be in the synchronizing, for example). Clients that need to download mostly recent blocks could be interested in connecting only with those nodes that have more blocks than what they already know.

For example, here we can see nodes with different heights (one is synchronizing):

image

knocte commented 3 years ago

Why don't you make the commit message the same as the PR description? It can have a body too, not just title. This would help immensely to people that use git blame.

lontivero commented 3 years ago

Why don't you make the commit message the same as the PR description?

Because messages in the commits are to explain the commits while the message in the PR is to describe the intention of the PR. For example, in a PR description I can write something like "This is probably an stupid idea, do you maintainer think I should write a test? Please feel free to whatever" but that's not something i would put in a commit.

knocte commented 3 years ago

in a PR description I can write something like "This is probably an stupid idea, do you maintainer think I should write a test? Please feel free to whatever" but that's not something i would put in a commit.

I agree with the particular example you just have mentioned, but this case doesn't match with this example. There's useful information in this PR description that would be great to have in the commit message. If you don't do it: 1) people using git blame will not see it; 2) if this repo moves away from github in the future, the information is lost forever too