net: Fix sent reject messages for blocks and transactions #7179

pull laanwj wants to merge 2 commits into bitcoin:master from laanwj:2015_12_fix_reject_message changing 5 files +123 −6
  1. laanwj commented at 1:58 pm on December 7, 2015: member
    Ever since we #5913 have been sending invalid reject messages for transactions and blocks.
  2. net: Fix sent reject messages for blocks and transactions
    Ever since we #5913 have been sending invalid reject messages
    for transactions and blocks.
    9fc6ed6003
  3. laanwj added the label Needs backport on Dec 7, 2015
  4. dcousens commented at 2:30 pm on December 7, 2015: contributor
    Worth adding a regression test?
  5. laanwj commented at 2:47 pm on December 7, 2015: member
    Would make sense.
  6. laanwj commented at 9:40 am on December 8, 2015: member

    To be clear, this solves the following issue:

    Normal reject message

    02015-12-07 20:16:52 peer=1096 Reject tx code 64: non-final: hash 54fae12b1dc553ec56137138ad28304569c9b3a69791fca5a02664b379a7d6ba
    

    Reject message from 0.11.99+

    02015-12-04 16:07:00 peer=322 Reject tx code 66: : hash 6e6f69746361736e617274206565726620646574696d696c20657461721d0000
    

    Reason seems empty, and part of the reason message ends up in the “hash”. This is due to the reject code being sent as multiple bytes instead of one, misaligning the message.

    Edit: trying to think of a test. Hopefully it could fit somewhere in the Python P2P test framework, without creating a new script.

  7. laanwj added this to the milestone 0.12.0 on Dec 8, 2015
  8. MarcoFalke commented at 9:47 am on December 8, 2015: member
    utACK 9fc6ed6
  9. laanwj commented at 4:15 pm on December 8, 2015: member
    Added basic tests for rejection of blocks and transactions. (tested that they pass with this patch, and fail without)
  10. laanwj force-pushed on Dec 8, 2015
  11. laanwj force-pushed on Dec 8, 2015
  12. laanwj force-pushed on Dec 8, 2015
  13. test: Add basic test for `reject` code
    Extend P2P test framework to make it possible to expect reject
    codes for transactions and blocks.
    20411903d7
  14. laanwj force-pushed on Dec 9, 2015
  15. laanwj commented at 9:02 am on December 9, 2015: member
    @sdaftuar Mind taking a look at the test changes?
  16. sdaftuar commented at 10:18 am on December 9, 2015: member
    Sure, will take a look.
  17. laanwj merged this on Dec 10, 2015
  18. laanwj closed this on Dec 10, 2015

  19. laanwj referenced this in commit 5dc63ed1ca on Dec 10, 2015
  20. laanwj referenced this in commit 44fef99e66 on Dec 10, 2015
  21. sdaftuar commented at 11:24 am on December 10, 2015: member
    post-merge ACK. The extension to the test framework seems like a good idea!
  22. luke-jr referenced this in commit e08060dd84 on Jan 10, 2016
  23. luke-jr referenced this in commit 3e167cfddd on Jan 10, 2016
  24. laanwj commented at 8:08 am on February 4, 2016: member
    This is cherry-picked to 0.12 as 44fef99e666e85caa7616765412d7becf97ab673, removing needs backport label
  25. laanwj removed the label Needs backport on Feb 4, 2016
  26. zkbot referenced this in commit 19a8c45f42 on Aug 13, 2021
  27. zkbot referenced this in commit 8e9f44cbe2 on Aug 13, 2021
  28. zkbot referenced this in commit cf9a0799b4 on Aug 17, 2021
  29. MarcoFalke locked this on Sep 8, 2021


laanwj dcousens MarcoFalke sdaftuar

Milestone
0.12.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-25 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me