Bitcoin Forum
June 27, 2024, 11:30:53 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: dnsseed problems  (Read 134 times)
hey_connor (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 20, 2019, 07:37:02 AM
 #1

I'm creating dnsseed based on https://github.com/sipa/bitcoin-seeder. But I got a problem when adapting the seeder software.
The variable "clientVersion" is compared with REQUIRE_VERSION(which is a protocol version) in the function IsGood,
Code:
if (clientVersion && clientVersion < REQUIRE_VERSION) return false;
while it is compared with 31900(which seems to be a client version v0.3.19) in the function GetBanTime.
Code:
if (clientVersion && clientVersion < 31900) { return 604800; }
I'm confused. What on earth should "clientVersion" be compared with? Client version or protocol version?
This is the output of bitcoin-cli.
Code:
$ bitcoin-cli getnetworkinfo
{
  "version": 170100,
  "subversion": "/Satoshi:0.17.1/",
  "protocolversion": 70015,
  ......
}
Looking forward reply. Thanks!
joe@exor
Jr. Member
*
Offline Offline

Activity: 43
Merit: 16


View Profile WWW
May 18, 2020, 03:30:15 AM
 #2

If you follow along with the commits for the bitcoin-seeder app, you will find that the line in GetBanTime which compares clientVersion to 31900 was added a couple years earlier than the line in IsGood which compares to REQUIRE_VERSION.

Dec 22, 2011: https://github.com/sipa/bitcoin-seeder/commit/8b2c4eca5f25f425f2911896125868fec4ca45d8#diff-fc4dfa6031995a26c16f099dd1e8143bR80
Apr 14, 2013: https://github.com/sipa/bitcoin-seeder/commit/d8e20ba4844201c0f2dd83c91d0fd614bc5c6cc8#diff-fc4dfa6031995a26c16f099dd1e8143bR96

Long story short, it certainly seems like an oversight that the 31900 value was left hardcoded and never updated. In my opinion, both values should be compared against the MIN_PEER_PROTO_VERSION value from version.h.

If you are still confused, feel free to take a look at how I handled this in my generic-seeder clone: https://bitcointalk.org/index.php?topic=5239304.0
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!