Bitcoin Forum
April 26, 2024, 12:43:32 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Node not responding to getdata message  (Read 1301 times)
TT (OP)
Member
**
Offline Offline

Activity: 77
Merit: 10



View Profile
November 13, 2011, 05:12:06 AM
 #1

I'm working on the network i/o for a bitcoin node. Immediately after receiving an inv message from a peer,
I'm sending it back but just changing the "inv" command to "getdata". It is my understanding that the inventory
list structure is identical in both types of message, and therefore the payload can be identical. Only the 12 byte
command code needs to be changed from {'i','n','v',0,0,0,0,0,0,0,0,0} to {'g','e','t','d','a','t','a',0,0,0,0,0}. Other
nodes seem to recognize the message as a getdata message, but are not replying with any tx or block messages.

Any ideas why?
The forum was founded in 2009 by Satoshi and Sirius. It replaced a SourceForge forum.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714135412
Hero Member
*
Offline Offline

Posts: 1714135412

View Profile Personal Message (Offline)

Ignore
1714135412
Reply with quote  #2

1714135412
Report to moderator
1714135412
Hero Member
*
Offline Offline

Posts: 1714135412

View Profile Personal Message (Offline)

Ignore
1714135412
Reply with quote  #2

1714135412
Report to moderator
1714135412
Hero Member
*
Offline Offline

Posts: 1714135412

View Profile Personal Message (Offline)

Ignore
1714135412
Reply with quote  #2

1714135412
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5180
Merit: 12900


View Profile
November 13, 2011, 05:22:52 AM
 #2

Are you updating the checksum?

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
TT (OP)
Member
**
Offline Offline

Activity: 77
Merit: 10



View Profile
November 13, 2011, 05:27:00 AM
 #3

If the payload is the same, wouldn't the checksum also remain the same?
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5180
Merit: 12900


View Profile
November 13, 2011, 06:16:22 AM
 #4

Ah, you're right about that.

Post a hexdump of what you're sending.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
TT (OP)
Member
**
Offline Offline

Activity: 77
Merit: 10



View Profile
November 13, 2011, 06:55:32 AM
Last edit: November 13, 2011, 01:19:53 PM by TT
 #5

OK, I received the following data:
----
Received data: 0xf9 0xbe 0xb4 0xd9 0x69 0x6e 0x76 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x25 0x00 0x00 0x00 0x8f 0xa1 0x8b 0x5e 0x01 0x01 0x00 0x00 0x00 0x79 0xb8 0x25 0x10 0x3d 0xca 0x85 0xf8 0x90 0xc2 0x24 0x79 0x22 0x1c 0x27 0xab 0x4f 0x73 0x60 0x49 0x94 0x54 0x3a 0xe8 0x3e 0x4a 0x4e 0x10 0x43 0x51 0x2b 0x8c
----
Formatted in human-readable form, it's:

Command: inv
Payload size(bytes): 37
Inventory count: 1
  Item 1:
    Type: MSG_TX
    Hash: 8c2b5143104e4a3ee83a54944960734fab271c227924c290f885ca3d1025b879

I'm sending back:
----
Sending getdata: 0xf9 0xbe 0xb4 0xd9 0x67 0x65 0x74 0x64 0x61 0x74 0x61 0x00 0x00 0x00 0x00 0x00 0x25 0x00 0x00 0x00 0x8f 0xa1 0x8b 0x5e 0x01 0x01 0x00 0x00 0x00 0x79 0xb8 0x25 0x10 0x3d 0xca 0x85 0xf8 0x90 0xc2 0x24 0x79 0x22 0x1c 0x27 0xab 0x4f 0x73 0x60 0x49 0x94 0x54 0x3a 0xe8 0x3e 0x4a 0x4e 0x10 0x43 0x51 0x2b 0x8c
----
TT (OP)
Member
**
Offline Offline

Activity: 77
Merit: 10



View Profile
November 13, 2011, 01:22:03 PM
 #6

I just dropped the four checksum bytes and it worked!

I think this detail was omitted in https://en.bitcoin.it/wiki/Protocol_specification

It says
Quote
The version and verack messages do not have a checksum, the payload starts 4 bytes earlier.

Apparently, this is also the case for getdata messages. Someone might want to update the wiki.

-TT
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5180
Merit: 12900


View Profile
November 14, 2011, 10:29:12 AM
 #7

Hmm... I'm pretty sure my network code puts a checksum on those messages.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
kokjo
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000

You are WRONG!


View Profile
November 14, 2011, 10:38:23 AM
 #8

Hmm... I'm pretty sure my network code puts a checksum on those messages.
mine too and they are working. putting checksums on anything, but version and verack

"The whole problem with the world is that fools and fanatics are always so certain of themselves and wiser people so full of doubts." -Bertrand Russell
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!