NodeSyncScore() should find the node which we recv data most recently, so put a negative sign to pnode->nLastRecv is indeed wrong.
Also change the return value type to int64_t.
Signed-off-by: Huang Le 4tarhl@gmail.com
NodeSyncScore() should find the node which we recv data most recently, so put a negative sign to pnode->nLastRecv is indeed wrong.
Also change the return value type to int64_t.
Signed-off-by: Huang Le 4tarhl@gmail.com
NodeSyncScore() should find the node which we recv data most recently, so put a negative sign to pnode->nLastRecv is indeed wrong.
Also change the return value type to int64_t.
Signed-off-by: Huang Le <4tarhl@gmail.com>
ACK on the sign change.
Meh on the type change.
The reason is (was) that at some point a more complex formula could be used.
@sipa Yep, that is what I guess. But since this is a internal utility function but a general interface, anytime when we adjust the scoring algorithm we shall always change the function, so it may not necessary to keep the return value to be still in double, which creates extra, though negligible, type casting cost here...
Do you think I should re-submit with keeping the original double type?
No worries, I have no problem with it. Just explaining the history.
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/09a54a65c0d05fe93c4a31603eca8a9a76ff6526 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
ACK. I like patches that clean up type usage.
ACK. I like patches that fix broken peer selection.