refactor: remove redundant fOnlySafe argument #21910

pull t-bast wants to merge 1 commits into bitcoin:master from t-bast:refactor-fonlysafe changing 3 files +8 −6
  1. t-bast commented at 7:59 am on May 11, 2021: member

    The fOnlySafe argument to AvailableCoins is now redundant, since #21359 added a similar field inside the CCoinControl struct (see #21359 (review)).

    Not all code paths create a CCoinControl instance, but when it’s missing we can default to using only safe inputs which is backwards-compatible.

  2. refactor: remove redundant fOnlySafe argument
    The fOnlySafe argument to AvailableCoins is now redundant, since #21359
    added a similar field inside the CCoinControl struct.
    
    Not all code paths set a CCoinControl instance, but when it's missing we
    can default to using only safe inputs which is backwards-compatible.
    c30dd02cd8
  3. laanwj added the label Refactoring on May 11, 2021
  4. fanquake requested review from achow101 on May 12, 2021
  5. fanquake requested review from instagibbs on May 12, 2021
  6. fanquake requested review from meshcollider on May 12, 2021
  7. instagibbs approved
  8. instagibbs commented at 2:27 am on May 12, 2021: member
    utACK c30dd02cd893d2bc34779516a13ae7156d3f8ba7
  9. in src/wallet/wallet.cpp:2200 in c30dd02cd8
    2196@@ -2197,7 +2197,7 @@ CAmount CWallet::GetAvailableBalance(const CCoinControl* coinControl) const
    2197 
    2198     CAmount balance = 0;
    2199     std::vector<COutput> vCoins;
    2200-    AvailableCoins(vCoins, true, coinControl);
    2201+    AvailableCoins(vCoins, coinControl);
    


    promag commented at 9:06 am on May 12, 2021:
    Not an actual refactor because this changes behavior. But in practice AMT there’s no call to GetAvailableBalance with m_include_unsafe_inputs = true.

    t-bast commented at 9:41 am on May 12, 2021:
    Good catch, it does change behavior here but is backwards-compatible so I think it should be ok. If later we want to make GetAvailableBalance with m_include_unsafe_inputs = true possible, we can use coinControl for that.
  10. promag commented at 9:06 am on May 12, 2021: member
    Code review ACK c30dd02cd893d2bc34779516a13ae7156d3f8ba7.
  11. achow101 approved
  12. achow101 commented at 6:48 pm on May 12, 2021: member
    ACK c30dd02cd893d2bc34779516a13ae7156d3f8ba7
  13. meshcollider commented at 9:05 am on May 13, 2021: contributor
    Code review + test run ACK c30dd02cd893d2bc34779516a13ae7156d3f8ba7
  14. meshcollider merged this on May 13, 2021
  15. meshcollider closed this on May 13, 2021

  16. sidhujag referenced this in commit 0bd7a957cf on May 13, 2021
  17. t-bast deleted the branch on May 13, 2021
  18. gwillen referenced this in commit 9096687c0e on Jun 1, 2022
  19. DrahtBot locked this on Aug 16, 2022

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-09-29 01:12 UTC

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