From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8667A267 for ; Tue, 13 Oct 2015 11:02:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.domob.eu (mail.domob.eu [92.222.9.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9E86A159 for ; Tue, 13 Oct 2015 11:02:38 +0000 (UTC) Received: from [0.0.0.0] (vps149390.ovh.net [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.domob.eu (Postfix) with ESMTPSA id 19F3922D8 for ; Tue, 13 Oct 2015 13:02:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=domob.eu; s=default; t=1444734155; bh=xMNl7V+ozx9CmHL10hhNIaqijx2P9x6j7kV/Rn9HCGk=; h=Date:From:To:Subject:From; b=ChgrAdrGBRyNJQdKbkoxw42qzDtlGS9YrOjGczVKxs+ebBnWqaRK+7YfnlHXFbMmu XC97RnCBEoWuptDckltLXfXEXRFRsm1+SDAkoRZO21oC97o+OkdoN9k5fFH9pzNy7c WQHtjLKtMYMdPEHD7muqegHaaubMCcMyo9HvBwey4t5wGIT2g9AdnhHj12bfYd32sz uLSomLhdT2WreD5SnYzmKnQWTemay/E4U5BzQe/yPK6rG9T87inLnbRPruxar41kg4 IPqWqs5Kg/UGosbLSSodJ1vL8ZQ8SWU/3ZoDR0Q4LMhrrKSIlkfd2Y6cSOIREh7vz2 4gw9mt4uubqoXIIH68X3CLLgKX6MwUU1o2B+ME0nuSZffncX8jUYzytAGvUXXJJ/rH GmmWQHifRwzGbSk4ryQIzYSxoasIIQO8N+nei3uAAjH5sF7SHsUvCIHgf6W8ALSO8P WEB5ul/NUhPONWzP7A46JkuOhampF7RBgoaJiZZomrXm8fBiawW73G3XcAzSrpMGJo 4/OGILXmvnp58WiWD9WDK5J8HkBo6WFMTPsht0LhBWgHiKJlWIGzU5N5KZIenKGT8Z 6rbL6miuPDIutFCOvD+s5iQ7kOesQmD4oWMmPLP1nb1FaW2qfKewsU6nxaEPqooOw6 0F6nuiTaRuFVJ1DHkQ7KGXrw= Message-ID: <561CE4C8.3000501@domob.eu> Date: Tue, 13 Oct 2015 13:02:32 +0200 From: Daniel Kraft User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: bitcoin-dev@lists.linuxfoundation.org OpenPGP: id=A7330737 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OefWMx2rntXTg5wHF9eu5ePwehkl5nhHD" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [bitcoin-dev] Initial getheaders request X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Development Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2015 11:02:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OefWMx2rntXTg5wHF9eu5ePwehkl5nhHD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 --=20 http://www.domob.eu/ OpenPGP: 1142 850E 6DFF 65BA 63D6 88A8 B249 2AC4 A733 0737 Namecoin: id/domob -> https://nameid.org/?name=3Ddomob -- Done: Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz To go: Mon-Pri --OefWMx2rntXTg5wHF9eu5ePwehkl5nhHD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJWHOTMAAoJEFcvuTrTyRk7dHcP/0nrT+pV7YDVaVSUhaJZc4Ag wwSsDVQECkh4urpZ54P8FmDF9fY8zJBQu9Qe0vT7t+oTb1wf1hVjEOWbGxNeCd6L HcWxYrIVK1AQL5MqfAqLP4VX+Q1UgClmVXiQo+0eobs3Dv07pfH2DQSCnxBM+Umd xl4JrCdJXsFG2O4UMc0VgEBA6cmbAXfR/9iVK8JDsQkmBFKtwV50WlsdCxp4Iadg 0V4luzKXLKlk/t5oVjLe4yxHSe2jkDuOAnsvdFaa18Vzxyua607A/+/GBD8OWQQ8 fbQP2AFNRIiDmJKTJYJLyimXPkzq/eO+Yq+mYne1IXiiF/imyCEaKBTiwe1xCVAO 2tdolFHtKtzaTY5NN1VSbPma2hMKhDEiviI/dTu1GJ5PR09W57H0Suiri556LA8Y 7YVdmQLpknqongLjtxPvttKf2RyzfbaITdADiX9R6tTlY63bFvqZsWbb91FCaEBw QYFsqQqDvmpOaDwHfdDfSw28hmIGu4g7KAkq+itkAyw6tHcymcxJFPOZU98yyfE3 hqDYTJ7vuT4oI0ubnpUh50tL8CSz6aGKy/jEOpgHSmWXAfeeluINu8YuZAvgU8MY tgEs0MFjrn4kQzEjeMvhBmIeGqczs6K9vssIsKcBupYff0LYeuzjUoItFKGTsuwW JaifYSfBA+jGUF6wr6/1 =8bhy -----END PGP SIGNATURE----- --OefWMx2rntXTg5wHF9eu5ePwehkl5nhHD--