wallet: Make fee settings to be non-static members #12909

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1804-walletMembers changing 16 files +186 −187
  1. MarcoFalke commented at 6:36 pm on April 7, 2018: member

    The wallet header defined some globals (they were called “settings”), that should be class members instead.

    This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc settxfee for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case)

  2. MarcoFalke added the label Wallet on Apr 7, 2018
  3. MarcoFalke added the label RPC/REST/ZMQ on Apr 7, 2018
  4. MarcoFalke commented at 6:36 pm on April 7, 2018: member
    For testing you can checkout this commit and run ./test/functional/wallet_multiwallet.py without compiling. It should fail.
  5. MarcoFalke added the label Needs release notes on Apr 7, 2018
  6. MarcoFalke force-pushed on Apr 7, 2018
  7. MarcoFalke removed the label Needs release notes on Apr 7, 2018
  8. MarcoFalke force-pushed on Apr 7, 2018
  9. MarcoFalke force-pushed on Apr 7, 2018
  10. MarcoFalke force-pushed on Apr 7, 2018
  11. MarcoFalke force-pushed on Apr 8, 2018
  12. MarcoFalke force-pushed on Apr 8, 2018
  13. MarcoFalke force-pushed on Apr 9, 2018
  14. MarcoFalke force-pushed on Apr 9, 2018
  15. in src/wallet/init.cpp:185 in fad3bc5cef outdated
    170@@ -183,22 +171,6 @@ bool WalletInit::ParameterInteraction()
    171                         _("This is the transaction fee you may discard if change is smaller than dust at this level"));
    172         CWallet::m_discard_rate = CFeeRate(nFeePerK);
    173     }
    174-    if (gArgs.IsArgSet("-paytxfee"))
    


    ryanofsky commented at 10:02 pm on April 9, 2018:

    Is there a reason not to make options like -discardfee and -mintxfee wallet members, the same way this is doing for -fallbackfee and -paytxfee options? It doesn’t seem like a good thing to create a distinction here when moving the options together is possible.

    Making more options members also seems nice in case we want to add a wallet RPC for changing preferences dynamically without affecting other wallets.


    MarcoFalke commented at 10:51 pm on April 9, 2018:
    mintxfee et al are already members (static, though). I agree that those should be changed to be non-static members, but I’d rather do this in a follow up pr. Otherwise this one will explode in scope, scare away revierers and will gracelessly end up in rebase hell.

    MarcoFalke commented at 10:51 pm on April 9, 2018:

    Making more options members also seems nice in case we want to add a wallet RPC for changing preferences dynamically without affecting other wallets.

    Please see the included test case: We are already doing it wrong.


    ryanofsky commented at 8:44 pm on April 13, 2018:

    #12909 (review)

    mintxfee et al are already members (static, though). I agree that those should be changed to be non-static members, but I’d rather do this in a follow up pr. Otherwise this one will explode in scope, scare away revierers and will gracelessly end up in rebase hell.

    I think “wallet-specific fee options” would be an appropriate scope for this PR and not too broad. The -mintxfee, -fallbackfee, -discardfee, and -paytxfee options are literally initialized one after another here, so it’s strange to me that you want to move the second and fourth initializations but not the first and third based them on being global variables instead of static class member variables (since all the variables function identically).

  16. laanwj commented at 6:05 am on April 11, 2018: member
    Concept ACK
  17. in src/interfaces/node.h:32 in fad3bc5cef outdated
    30 struct CNodeStateStats;
    31 
    32-namespace interfaces {
    33-
    34+namespace interfaces
    35+{
    


    ryanofsky commented at 8:33 pm on April 13, 2018:
    Maybe revert this formatting change (this is what caused me to open #12982).
  18. ryanofsky commented at 8:46 pm on April 13, 2018: member
    utACK fad3bc5cef786049f70ff485001e9e11791ef350
  19. MarcoFalke force-pushed on Apr 14, 2018
  20. MarcoFalke force-pushed on Apr 14, 2018
  21. MarcoFalke renamed this:
    wallet: Make "settings" to be class members
    wallet: Make fee settings to be non-static members
    on Apr 14, 2018
  22. MarcoFalke force-pushed on Apr 14, 2018
  23. MarcoFalke force-pushed on Apr 14, 2018
  24. MarcoFalke force-pushed on Apr 14, 2018
  25. MarcoFalke force-pushed on Apr 14, 2018
  26. MarcoFalke force-pushed on Apr 14, 2018
  27. MarcoFalke commented at 3:24 am on April 17, 2018: member
    Removed static from three more members as requested by @ryanofsky
  28. jnewbery commented at 6:45 pm on April 17, 2018: member
    p2p_compactblocks.py failed in Travis. Rebase on master to pick up fix?
  29. MarcoFalke commented at 6:56 pm on April 17, 2018: member

    @jnewbery Travis seems to fetch from git fetch origin +refs/pull/${PULL_NUMBER}/merge, so a re-run should suffice?

    C.f. https://travis-ci.org/bitcoin/bitcoin/jobs/366515927#L356

  30. in src/wallet/rpcwallet.cpp:2764 in fa66188a5c outdated
    2757@@ -2758,10 +2758,10 @@ UniValue settxfee(const JSONRPCRequest& request)
    2758         return NullUniValue;
    2759     }
    2760 
    2761-    if (request.fHelp || request.params.size() < 1 || request.params.size() > 1)
    2762+    if (request.fHelp || request.params.size() < 1 || request.params.size() > 1) {
    2763         throw std::runtime_error(
    2764             "settxfee amount\n"
    2765-            "\nSet the transaction fee per kB. Overwrites the paytxfee parameter.\n"
    2766+            "\nSet the transaction fee per kB for this wallet. Overwrites the global -paytxfee command line parameter.\n"
    


    ryanofsky commented at 9:44 pm on April 17, 2018:
    Comment is kind of misleading. I think it would be more accurate to say “overrides” instead of “overwrites” now.

    MarcoFalke commented at 10:01 pm on April 17, 2018:
    TIL those words mean different things. Thx and done. Should be trivial to re-ACK if you still have the previous commit.
  31. ryanofsky commented at 9:50 pm on April 17, 2018: member
    utACK fa66188a5c8b862695dd8d730f7c900bfd303dcf. This is great cleanup! It’s really nice to see these settings start to get consolidated and handled in a consistent way.
  32. MarcoFalke force-pushed on Apr 17, 2018
  33. ryanofsky commented at 10:37 pm on April 17, 2018: member
    utACK fafdeca1ec5d32291fe7b0313e123ad22d8e284b. Only change since the previous review is the updated RPC documentation string.
  34. MarcoFalke force-pushed on Apr 19, 2018
  35. MarcoFalke force-pushed on Apr 19, 2018
  36. MarcoFalke commented at 1:15 pm on April 19, 2018: member
    Clean rebase to reduce the diff (getting rid of deleted node-interface methods)
  37. ryanofsky commented at 1:20 pm on April 19, 2018: member
    utACK eeeea3c066f8b1351b911593aac7b062f48f1976, only change since last review is rebase
  38. in src/wallet/wallet.h:44 in eeeea3c066 outdated
    46-
    47 //! Default for -keypool
    48 static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000;
    49 //! -paytxfee default
    50-static const CAmount DEFAULT_TRANSACTION_FEE = 0;
    51+constexpr CAmount DEFAULT_PAY_TX_FEE = 0;
    


    jnewbery commented at 4:59 pm on April 19, 2018:
    Seems a little weird to change this to constexpr and leave all the other default constants as static const. It’s fine, but can we have a follow-up PR to change the remaining constants to constexprs?

    MarcoFalke commented at 5:54 pm on April 19, 2018:
    Sure. There is a bit of refactoring going on in the wallet, so I will wait until the dust settled a bit.
  39. jnewbery commented at 5:00 pm on April 19, 2018: member
    utACK eeeea3c066f8b1351b911593aac7b062f48f1976 with request for follow-up commit.
  40. laanwj commented at 10:11 am on April 23, 2018: member
    Sorry, needs rebase again
  41. laanwj assigned laanwj on Apr 23, 2018
  42. jonasschnelli commented at 12:00 pm on April 23, 2018: contributor
    Concept ACK (utACK on eeeea3c066f8b1351b911593aac7b062f48f1976 which though requires rebase).
  43. MarcoFalke force-pushed on Apr 23, 2018
  44. wallet: Make fee settings non-static members fac0db0ff8
  45. MarcoFalke force-pushed on Apr 23, 2018
  46. MarcoFalke commented at 2:53 pm on April 23, 2018: member
    Rebased
  47. in src/interfaces/node.h:29 in fac0db0ff8
    25@@ -26,11 +26,9 @@ class Coin;
    26 class RPCTimerInterface;
    27 class UniValue;
    28 class proxyType;
    29-enum class FeeReason;
    


    promag commented at 3:27 pm on April 23, 2018:
    Also remove CCoinControl forward declaration?

    MarcoFalke commented at 11:33 pm on April 23, 2018:
    Will leave it in for now, because I don’t want to go through another rebase-reACK iteration just for this. Also, there are redundant forward declarations in other parts of the code, so this is not making the overall problem worse.

    promag commented at 0:02 am on April 24, 2018:
    Yeah, don’t mind that, just noted in case you have to push again.
  48. promag commented at 3:41 pm on April 23, 2018: member

    This commit is hopefully only refactoring, apart from a multiwallet bugfix

    Probably not that problematic, it’s very unlikely someone depends on the current behavior, but I think this could have release note.

    utACK fac0db0.

  49. jnewbery commented at 3:46 pm on April 23, 2018: member

    I think this could have release note.

    I don’t think it’s necessary. We don’t add notes for every bugfix, and this seems very trivial.

  50. jnewbery commented at 4:07 pm on April 23, 2018: member
    tested ACK fac0db0ff8e72ca30a0da8a64fc1d115dd2d6f8c
  51. laanwj merged this on Apr 24, 2018
  52. laanwj closed this on Apr 24, 2018

  53. laanwj referenced this in commit 476cb35551 on Apr 24, 2018
  54. MarcoFalke deleted the branch on Apr 24, 2018
  55. UdjinM6 referenced this in commit 6b75224f01 on May 21, 2021
  56. UdjinM6 referenced this in commit 97fdd3e36d on May 21, 2021
  57. UdjinM6 referenced this in commit d41a40e137 on May 21, 2021
  58. UdjinM6 referenced this in commit 4aca43e24a on May 22, 2021
  59. kittywhiskers referenced this in commit 9e8d135e65 on May 25, 2021
  60. 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: 2024-12-18 18:12 UTC

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