1

It seems my 'getheaders' request is being ignored by peers. I've followed the implementation: https://en.bitcoin.it/wiki/Protocol_documentation#getheaders without success.

If I change it to 'getblocks' then it returns an inv[500] message just fine. But for some reason, it's not returning a 'headers' packet when requesting headers.

I'm connected to over 100 peers, and still no success.

Has anyone else had similar trouble before? Any guidance is appreciated.

The request values are as follows:

    magic=3908297187
    command=getheaders
    length=69 
    checksum=1021834552
    payload=[version=70013, hashCount=1, blockLocatorHash=[00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048], hashStop=0000000000000000000000000000000000000000000000000000000000000000]

and the encoded bytes are:

e3e1f3e876657273696f6e000000000069000000a4d49d4e7d11010004000000000000002cb0db5d73010000000000000000000000000000000000000000ffff7f000001208d000000000000000000000000000000000000ffff0fa518f420a100ecfbdaa2585542132f626974636f696e6a2d73763a302e302e372f0000000000

Just to note, when serializing, i reverse the blockLocatorHash bytes as mentioned in the wiki.

Cheers,

Murch
  • 71,155
  • 33
  • 180
  • 600

1 Answers1

2

It looks like the magic bytes you are using isn't the Bitcoin magic bytes. You have e3e1f3e8 but Bitcoin's network magic is f9beb4d9.

Andrew Chow
  • 67,209
  • 5
  • 76
  • 149