Bitcoin Forum
May 09, 2024, 02:33:39 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bug? - getaddr command contains checksum despite having no payload  (Read 1925 times)
0x6763
Guest

January 13, 2011, 05:21:52 PM
Last edit: January 13, 2011, 07:08:19 PM by 0x6763
 #1

This is part of a packet from the current 0.3.19 linux client:

Code:
0000   F9 BE B4 D9 67 65 74 61  64 64 72 00 00 00 00 00   ....getaddr.....
0010   00 00 00 00 5D F6 E0 E2                            ....]...

It is my understanding that if there is no payload, there should be no checksum.  Is my understanding correct and this is a bug?
1715265219
Hero Member
*
Offline Offline

Posts: 1715265219

View Profile Personal Message (Offline)

Ignore
1715265219
Reply with quote  #2

1715265219
Report to moderator
1715265219
Hero Member
*
Offline Offline

Posts: 1715265219

View Profile Personal Message (Offline)

Ignore
1715265219
Reply with quote  #2

1715265219
Report to moderator
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715265219
Hero Member
*
Offline Offline

Posts: 1715265219

View Profile Personal Message (Offline)

Ignore
1715265219
Reply with quote  #2

1715265219
Report to moderator
1715265219
Hero Member
*
Offline Offline

Posts: 1715265219

View Profile Personal Message (Offline)

Ignore
1715265219
Reply with quote  #2

1715265219
Report to moderator
Cdecker
Hero Member
*****
Offline Offline

Activity: 489
Merit: 504



View Profile WWW
January 13, 2011, 06:38:56 PM
 #2

I had the same problem, but yes the checksum for an empty message (byte[0]) is 0x5DF6E0E2 so that's correct Cheesy Useless but correct.

Want to see what developers are chatting about? http://bitcoinstats.com/irc/bitcoin-dev/logs/
Bitcoin-OTC Rating
0x6763
Guest

January 13, 2011, 07:02:55 PM
 #3

I had the same problem, but yes the checksum for an empty message (byte[0]) is 0x5DF6E0E2 so that's correct Cheesy Useless but correct.

Yeah, I was able to work around it without a problem.  I asked about this in IRC a day or two ago, but no one had anything useful to say about it, so I figured I'd bring it up in the forum, so if it is a bug (seems to be no reason for it to be there), that it could get fixed.  Otherwise it might cause some problems for other people working on their own Bitcoin implementations.  I made a note about it in the wiki:

https://en.bitcoin.it/wiki/Protocol_specification#getaddr
Cdecker
Hero Member
*****
Offline Offline

Activity: 489
Merit: 504



View Profile WWW
January 14, 2011, 01:02:21 AM
 #4

Well to be precise there are quite a few messages without payload that have checksums (see ping for example) I don't think this should be labeled as a bug, it's simpler not to have a special case for empty payload messages when stripping the message header :-)

Want to see what developers are chatting about? http://bitcoinstats.com/irc/bitcoin-dev/logs/
Bitcoin-OTC Rating
0x6763
Guest

January 14, 2011, 02:21:33 AM
 #5

Well to be precise there are quite a few messages without payload that have checksums (see ping for example) I don't think this should be labeled as a bug, it's simpler not to have a special case for empty payload messages when stripping the message header :-)

So do all messages (except 'version' and 'verack') contain checksums regardless of whether or not they have a payload?
Cdecker
Hero Member
*****
Offline Offline

Activity: 489
Merit: 504



View Profile WWW
January 14, 2011, 01:43:11 PM
 #6

Yup

Want to see what developers are chatting about? http://bitcoinstats.com/irc/bitcoin-dev/logs/
Bitcoin-OTC Rating
0x6763
Guest

January 14, 2011, 01:44:21 PM
 #7

Yup

Interesting, thanks.
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!