Split logic to undo txin's off DisconnectBlock. #5699

pull domob1812 wants to merge 1 commits into bitcoin:master from domob1812:btc-txinundo changing 1 files +38 −24
  1. domob1812 commented at 1:55 PM on January 23, 2015: contributor

    Instead, create a separate function that applies the undo operation of a CTxInUndo object onto a CCoinsViewCache. This method is used from DisconnectBlock.

    This is a rebased version of #5192. I had to re-submit it, since the old pull request does no longer pick up changes. The reason for that is that namecoin/namecoin was changed to be no longer a fork of bitcoin/bitcoin, and the old pull request was done via domob1812/namecoin (forked from namecoin/namecoin).

  2. fanquake commented at 4:10 PM on January 23, 2015: member

    @sipa Care to re-review this?

  3. laanwj added the label Improvement on Jan 26, 2015
  4. domob1812 force-pushed on Feb 2, 2015
  5. domob1812 commented at 6:25 PM on February 2, 2015: contributor

    Rebased. Can this be merged, or is there anything I still have to do?

  6. TheBlueMatt commented at 12:11 AM on February 3, 2015: member

    utACK

  7. in src/main.cpp:None in ff56c9c50a outdated
    1601 | +
    1602 | +    CCoinsModifier coins = view.ModifyCoins(out.hash);
    1603 | +    if (undo.nHeight != 0) {
    1604 | +        // undo data contains height: this is the last output of the prevout tx being spent
    1605 | +        if (!coins->IsPruned())
    1606 | +            fClean = fClean && error("DisconnectBlock(): undo data overwriting existing transaction");
    


    sipa commented at 4:44 AM on February 3, 2015:

    Change the DisconnectBlock() to ApplyTxInUndo() (or even better, replace it with %s: with FILE).

  8. sipa commented at 4:56 AM on February 3, 2015: member

    utACK apart from the above nit

  9. domob1812 force-pushed on Feb 3, 2015
  10. Split logic to undo txin's off DisconnectBlock.
    Instead, create a separate function that applies the undo operation of a
    CTxInUndo object onto a CCoinsViewCache.  This method is used from
    DisconnectBlock.
    eb1c2cd37f
  11. domob1812 force-pushed on Feb 3, 2015
  12. domob1812 commented at 2:45 PM on February 3, 2015: contributor

    Fixed the nit.

  13. laanwj commented at 12:15 PM on February 9, 2015: member

    ACK, verfied code moves only apart from some error() message changes.

  14. laanwj merged this on Feb 9, 2015
  15. laanwj closed this on Feb 9, 2015

  16. laanwj referenced this in commit 183ca292bd on Feb 9, 2015
  17. 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-21 18:15 UTC

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