Policy: Move CTxOut::IsDust() to policy.o #5114

pull jtimon wants to merge 2 commits into bitcoin:master from jtimon:dust changing 24 files +122 −94
  1. jtimon commented at 7:32 AM on October 21, 2014: contributor

    Built on top of #5100. Decouples CTxOut from CFeeRate. Related to #5071 , now IsDust can become a method of CNodePolicy.

  2. in src/chainparams.h:None in 75c9668bed outdated
       5 | @@ -6,8 +6,8 @@
       6 |  #ifndef BITCOIN_CHAIN_PARAMS_H
       7 |  #define BITCOIN_CHAIN_PARAMS_H
       8 |  
       9 | -#include "core.h"
      10 |  #include "chainparamsbase.h"
      11 | +#include "core/block.h"
    


    Diapolo commented at 10:32 AM on October 21, 2014:

    Nit: Should be below checkpoints.

  3. in src/compressor.cpp:None in 75c9668bed outdated
     142 | +    if (e < 9) {
     143 | +        int d = (n % 10);
     144 | +        assert(d >= 1 && d <= 9);
     145 | +        n /= 10;
     146 | +        return 1 + (n * 9 + d - 1) * 10 + e;
     147 | +    } else {
    


    Diapolo commented at 10:34 AM on October 21, 2014:

    This else could just be removed as it's the last return anyway.


    jtimon commented at 7:43 PM on October 21, 2014:

    But it's not something I want to change in a MOVEONLY commit.

  4. in src/core/transaction.cpp:None in 75c9668bed outdated
      10 | +std::string COutPoint::ToString() const
      11 | +{
      12 | +    return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0, 10), n);
      13 | +}
      14 | +
      15 | +CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, uint32_t nSequenceIn)
    


    Diapolo commented at 10:38 AM on October 21, 2014:

    Just wondering, why arent't these references?


    jtimon commented at 7:43 PM on October 21, 2014:

    Again, not something I want to change in a MOVEONLY commit.

  5. in src/init.cpp:None in 75c9668bed outdated
       8 | @@ -9,6 +9,7 @@
       9 |  
      10 |  #include "init.h"
      11 |  
      12 | +#include "amount.h"
    


    Diapolo commented at 10:39 AM on October 21, 2014:

    Nit: Should be below addrman.

  6. jtimon force-pushed on Oct 21, 2014
  7. laanwj added the label Improvement on Oct 22, 2014
  8. jtimon force-pushed on Oct 23, 2014
  9. jtimon force-pushed on Oct 27, 2014
  10. jtimon force-pushed on Oct 28, 2014
  11. jtimon commented at 1:31 PM on October 28, 2014: contributor

    Rebased to make it more readable.

  12. sipa commented at 3:37 PM on October 29, 2014: member

    If you're moving it, can you move it to main instead? It really doesn't belong in core..

  13. jtimon force-pushed on Oct 30, 2014
  14. jtimon force-pushed on Oct 30, 2014
  15. jtimon commented at 12:28 PM on October 30, 2014: contributor

    Moved it to policy.o, where I think it belongs.

  16. sipa commented at 1:34 PM on November 4, 2014: member

    utACK

  17. jtimon commented at 10:44 AM on November 5, 2014: contributor

    We have to take into account that this will conflict with #5071.

  18. jtimon force-pushed on Dec 27, 2014
  19. jtimon commented at 5:37 PM on December 27, 2014: contributor

    Needed rebase (was including core/transaction instead of privitives/transaction).

  20. petertodd commented at 10:12 AM on December 28, 2014: contributor

    utACK

  21. jtimon force-pushed on Dec 29, 2014
  22. jtimon commented at 2:12 PM on December 29, 2014: contributor

    Added a couple of potential improvements to comment on (moving global minRelayTxFee from main to policy and hiding it for IsDust() calls). Also it needed a small include rebase.

  23. jtimon force-pushed on Dec 29, 2014
  24. jtimon force-pushed on Dec 29, 2014
  25. jtimon cross-referenced this on Dec 30, 2014 from issue WIP: Policy: Separate standard and testing policies by jtimon
  26. jtimon cross-referenced this on Dec 30, 2014 from issue Introduce CNodePolicy for putting isolated node policy code and parameters on by luke-jr
  27. petertodd commented at 4:20 AM on January 3, 2015: contributor

    utACK

  28. jtimon force-pushed on Jan 3, 2015
  29. jtimon renamed this:
    Turn CTxOut::IsDust() into an independent function
    Move CTxOut::IsDust() to policy.o
    on Jan 3, 2015
  30. jtimon renamed this:
    Move CTxOut::IsDust() to policy.o
    Policy: Move CTxOut::IsDust() to policy.o
    on Jan 3, 2015
  31. jtimon commented at 3:44 PM on January 3, 2015: contributor

    Sorry for touching it again, moved to 2 commits instead of 3. Now it shares the first commit with #5180.

  32. jtimon cross-referenced this on Jan 3, 2015 from issue Policy: Create CPolicy interface and CStandardPolicy class implementing it by jtimon
  33. sipa commented at 3:19 PM on January 4, 2015: member

    Untested ACK

  34. laanwj added the label TX fees and policy on Jan 8, 2015
  35. jtimon cross-referenced this on Jan 8, 2015 from issue Encapsulate policy by jtimon
  36. jtimon force-pushed on Jan 12, 2015
  37. jtimon force-pushed on Jan 12, 2015
  38. jtimon cross-referenced this on Jan 13, 2015 from issue Policy: Continue policy movements by jtimon
  39. jtimon force-pushed on Jan 21, 2015
  40. jtimon force-pushed on Jan 21, 2015
  41. jtimon commented at 1:41 PM on January 21, 2015: contributor

    I am very sorry for delaying this again, but I'm closing until it's clear how the first step for policy should be. Something I invite reviewers to discuss at #5595 where I've placed some examples.

  42. jtimon closed this on Jan 21, 2015

  43. jtimon cross-referenced this on Jun 6, 2015 from issue Policy: Create CPolicy interface and CStandardPolicy class implementing it by jtimon
  44. jtimon reopened this on Jul 12, 2015

  45. jtimon force-pushed on Jul 12, 2015
  46. jtimon commented at 2:23 PM on July 12, 2015: contributor

    Reopened. I was waiting for #5595 #6068, but no real reason to keep waiting. I'm also moving CFeeRate out of consensus to policy/fees (previously was necessary for primitives/transaction).

  47. jtimon force-pushed on Jul 16, 2015
  48. Policy: Refactor: CTxOut::IsDust(CFeeRate) -> CPolicy::ValidateOutput(CTxOut)
    Decouples CTxOut from CFeeRate
    Simplifies IsDust() interface encapsulating the access to global minRelayTxFee
    c14381c57b
  49. MOVEONLY: Consensus: Policy: Move CFeeRate from amount.o to policy/fees.o e2851a2c8c
  50. jtimon force-pushed on Jul 16, 2015
  51. jtimon commented at 6:36 PM on July 20, 2015: contributor

    Needs rebase and I'm thinking about moving the functions to the fee estimator (policy/fees) instead of policy/policy, so closing for now.

  52. jtimon closed this on Jul 20, 2015

  53. jtimon cross-referenced this on Feb 26, 2016 from issue Encapsulate options for mempool policy by morcos
  54. jtimon cross-referenced this on Mar 16, 2016 from issue [amount] Extend GetFee() by optional flag ceil by MarcoFalke
  55. jtimon cross-referenced this on Apr 5, 2016 from issue Consensus: Policy: Move CFeeRate out of consensus module and create CPolicy interface by jtimon
  56. jtimon cross-referenced this on Feb 11, 2017 from issue Consensus: Move CFeeRate out of libconsensus by jtimon
  57. bitcoin 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-05-19 06:55 UTC