Replace struct update_fee_delta with lambda #24625

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:2203-refactor-fee-delta-🔶 changing 3 files +8 −18
  1. MarcoFalke commented at 10:41 am on March 21, 2022: member

    The same was done for another struct in e177fcab3831b6d259da5164cabedcc9e78f6957.

    Also, change type of feeDelta from int64_t to CAmount.

  2. Replace struct update_fee_delta with lambda fa8857c3f7
  3. MarcoFalke added the label Refactoring on Mar 21, 2022
  4. MarcoFalke added the label Mempool on Mar 21, 2022
  5. hebasto commented at 11:51 am on March 21, 2022: member
    Concept ACK.
  6. DrahtBot commented at 12:03 pm on March 21, 2022: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #23418 (Fix signed integer overflow in prioritisetransaction RPC by MarcoFalke)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. in src/txmempool.h:134 in fa131d3630 outdated
    130@@ -131,7 +131,7 @@ class CTxMemPoolEntry
    131     std::chrono::seconds GetTime() const { return std::chrono::seconds{nTime}; }
    132     unsigned int GetHeight() const { return entryHeight; }
    133     int64_t GetSigOpCost() const { return sigOpCost; }
    134-    int64_t GetModifiedFee() const { return nFee + feeDelta; }
    135+    CAmount GetModifiedFee() const { return nFee + feeDelta; }
    


    hebasto commented at 12:30 pm on March 21, 2022:

    Also suggesting to add:

     0--- a/src/node/miner.h
     1+++ b/src/node/miner.h
     2@@ -45,7 +45,7 @@ struct CTxMemPoolModifiedEntry {
     3         nSigOpCostWithAncestors = entry->GetSigOpCostWithAncestors();
     4     }
     5 
     6-    int64_t GetModifiedFee() const { return iter->GetModifiedFee(); }
     7+    CAmount GetModifiedFee() const { return iter->GetModifiedFee(); }
     8     uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; }
     9     CAmount GetModFeesWithAncestors() const { return nModFeesWithAncestors; }
    10     size_t GetTxSize() const { return iter->GetTxSize(); }
    

    MarcoFalke commented at 12:38 pm on March 21, 2022:
    Thx, done
  8. hebasto approved
  9. hebasto commented at 12:30 pm on March 21, 2022: member
    ACK fa131d3630bb8da6816e50a9a37c0ed4ad4ee33c, I have reviewed the code.
  10. Use CAmount for fee delta and modified fee fa84a49526
  11. MarcoFalke force-pushed on Mar 21, 2022
  12. hebasto approved
  13. hebasto commented at 12:39 pm on March 21, 2022: member
    re-ACK fa84a49526fcf76e98b0b2f4d4b00b34a8dddf46
  14. promag commented at 9:49 pm on March 21, 2022: member
    Code review ACK fa84a49526fcf76e98b0b2f4d4b00b34a8dddf46.
  15. MarcoFalke commented at 6:39 am on March 22, 2022: member
    I didn’t touch the other structs, as they take multiple arguments. I think before touching them, we should ideally decide whether to use designated initializers or clang-tidy named arguments.
  16. fanquake commented at 12:48 pm on March 24, 2022: member
    @glozow want to review?
  17. glozow commented at 3:23 pm on March 24, 2022: member
    Concept ACK, haven’t reviewed code
  18. fanquake merged this on Mar 24, 2022
  19. fanquake closed this on Mar 24, 2022

  20. MarcoFalke deleted the branch on Mar 24, 2022
  21. sidhujag referenced this in commit c93c70ac8d on Apr 2, 2022
  22. Fabcien referenced this in commit a71672691a on Nov 23, 2022
  23. DrahtBot locked this on Mar 24, 2023

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-12-21 15:12 UTC

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