Fix removing of orphan transactions #5985

pull morcos wants to merge 1 commits into bitcoin:master from morcos:fix-orphans changing 1 files +4 −3
  1. morcos commented at 5:10 PM on April 8, 2015: member

    The transaction thats being accepted can't be an orphan otherwise it would have previously been accepted, so doesn't need to be added to the erase queue. We also don't want to erase orphans that still have missing inputs.

  2. dgenr8 commented at 9:12 PM on April 13, 2015: contributor

    utACK

  3. in src/main.cpp:None in 3588633a87 outdated
    4026 | @@ -4028,6 +4027,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
    4027 |                          }
    4028 |                          // too-little-fee orphan
    


    dgenr8 commented at 9:13 PM on April 13, 2015:

    This (pre-existing) comment is too specific to be correct.

  4. in src/main.cpp:None in 3588633a87 outdated
    3978 | @@ -3979,7 +3979,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
    3979 |              mempool.check(pcoinsTip);
    3980 |              RelayTransaction(tx);
    3981 |              vWorkQueue.push_back(inv.hash);
    3982 | -            vEraseQueue.push_back(inv.hash);
    


    sipa commented at 2:47 PM on April 27, 2015:

    Why can't we mark a tx for removal already? It was accepted into the memory pool, so alls its inputs must be satisfied?


    morcos commented at 2:58 PM on April 27, 2015:

    This tx isn't in the orphan map. We're just now receiving it off the network and accepting it to the mempool, so it never entered the orphan map. If it was a duplicate transaction that was an orphan the first time it was received, it would have previously been accepted to the mempool at the time its inputs were satisfied, and wouldn't be accepted here.

    It doesn't hurt to add tx to vEraseQueue, but its unnecessary and confuses the logic.

  5. laanwj added the label Bug on Apr 29, 2015
  6. Fix removing of orphan transactions
    We don't want to erase orphans that still have missing inputs, they should still be tracked as orphans.  Also, the transaction thats being accepted can't be an orphan otherwise it would have previously been accepted, so doesn't need to be added to the erase queue.
    14d4eef799
  7. morcos force-pushed on May 12, 2015
  8. morcos commented at 4:15 PM on May 12, 2015: member

    Fixed comment nit and clarified commit message

  9. mrbandrews commented at 7:51 PM on May 27, 2015: contributor

    Tested ACK

  10. laanwj commented at 10:14 AM on June 10, 2015: member

    utACK

  11. laanwj merged this on Jun 10, 2015
  12. laanwj closed this on Jun 10, 2015

  13. laanwj referenced this in commit 3a1d3e8f52 on Jun 10, 2015
  14. laanwj referenced this in commit 37b4e425af on Jun 10, 2015
  15. laanwj commented at 10:18 AM on June 10, 2015: member

    Cherry-picked to 0.11 branch as 37b4e425af00b285fb66ac1169d1c115e924b9a2

  16. MarcoFalke locked this on Sep 8, 2021

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: 2026-04-22 12:15 UTC

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