public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Daniel Kraft <d@domob•eu>
To: bitcoin-dev@lists•linuxfoundation.org
Subject: [bitcoin-dev] Initial getheaders request
Date: Tue, 13 Oct 2015 13:02:32 +0200	[thread overview]
Message-ID: <561CE4C8.3000501@domob.eu> (raw)

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

Hi!

I've stumbled upon the code that does the initial "getheaders" request,
i. e., around line 4960 of src/main.cpp [1].

  [1] https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L4960

For some reason, it uses not pindexBestHeader but the *preceding* block
pindexBestHeader->pprev as the "from argument".  In contrast, the
request on line 4132 [2] (which is done in response to a newly announced
block) *does* use pindexBestHeader.

  [2] https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L4132

I see no apparent reason for using the preceding call; but if I change
it to pindexBestHeader on line 4960 as well, the wallet.py test seems to
get stuck.  I've not been able to figure out from the logs and the code
why this is the case; can anyone help me?  I think this is something
that should really be explained in a comment around line 4960.  If
someone can make me understand, I can write a pull request for that -- I
guess this will save others some time wondering like I do at the moment.

Yours,
Daniel

-- 
http://www.domob.eu/
OpenPGP: 1142 850E 6DFF 65BA 63D6  88A8 B249 2AC4 A733 0737
Namecoin: id/domob -> https://nameid.org/?name=domob
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

                 reply	other threads:[~2015-10-13 11:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561CE4C8.3000501@domob.eu \
    --to=d@domob$(echo .)eu \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox