[wallet] Add high transaction fee warnings #8486

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1607-walletHighFeeWarn changing 4 files +24 −8
  1. MarcoFalke commented at 1:50 pm on August 8, 2016: member
    Add missing warnings to mintxfee and minrelaytxfee (c.f warnings for fallbackfee and paytxfee)
  2. MarcoFalke added the label Docs and Output on Aug 8, 2016
  3. MarcoFalke added the label Wallet on Aug 8, 2016
  4. MarcoFalke force-pushed on Aug 8, 2016
  5. MarcoFalke force-pushed on Aug 8, 2016
  6. in src/init.cpp: in fa304ad52c outdated
    960+        if (!ParseMoney(mapArgs["-minrelaytxfee"], n))
    961             return InitError(AmountErrMsg("minrelaytxfee", mapArgs["-minrelaytxfee"]));
    962+#ifdef ENABLE_WALLET
    963+        if (!fDisableWallet && n > HIGH_TX_FEE_PER_KB)
    964+            InitWarning(AmountHighWarn("-minrelaytxfee") + " " +
    965+                        _("This is the minimum transaction fee you pay on every transaction."));
    


    sipa commented at 5:35 am on August 10, 2016:
    Minrelayfee influences more than the fee you pay yourself. Isn’t it a bit confusing to advertize it as just that?

    MarcoFalke commented at 7:18 am on August 10, 2016:

    Right, but this is irrelevant for the wallet. If you run with the wallet disabled, you can use minrelayfee with the feefilter to approach a -blocksonly mode for minrelayfee → ∞.

    With the wallet enabled, it should warn when you are about to pay a fee too high.

    I have moved this code to wallet.cpp to make that clearer.

  7. in src/wallet/wallet.cpp: in fa304ad52c outdated
    3442@@ -3441,6 +3443,7 @@ bool CWallet::ParameterInteraction()
    3443             return InitError(AmountErrMsg("paytxfee", mapArgs["-paytxfee"]));
    3444         if (nFeePerK > HIGH_TX_FEE_PER_KB)
    3445             InitWarning(_("-paytxfee is set very high! This is the transaction fee you will pay if you send a transaction."));
    


    sipa commented at 5:36 am on August 10, 2016:
    Use AmountHighWarn here as well?

    MarcoFalke commented at 7:20 am on August 10, 2016:
    Done
  8. MarcoFalke force-pushed on Aug 10, 2016
  9. sipa commented at 1:22 pm on August 25, 2016: member
    utACK
  10. in src/init.cpp: in 0000b603d8 outdated
    958-            ::minRelayTxFee = CFeeRate(n);
    959-        else
    960+        if (!ParseMoney(mapArgs["-minrelaytxfee"], n))
    961             return InitError(AmountErrMsg("minrelaytxfee", mapArgs["-minrelaytxfee"]));
    962+        // High fee check is done afterward in CWallet::ParameterInteraction()
    963+        ::minRelayTxFee = CFeeRate(n);
    


    luke-jr commented at 3:13 am on August 29, 2016:
    Why is this being rearranged? It seems functionally identical except missing the n>0 check?

    MarcoFalke commented at 7:47 am on August 29, 2016:

    We don’t use the n>0 elsewhere because it is redundant:

    0src/test/util_tests.cpp:    BOOST_CHECK(!ParseMoney("-1", ret));
    

    Also, the syntax is preferable:

    0if(fail)
    1  return;
    2doStuff();
    

    vs

    0if(!fail)
    1  doStuff();
    2else
    3  return;
    
  11. luke-jr commented at 3:14 am on August 29, 2016: member
    Concept ACK
  12. [wallet] Add high transaction fee warnings faef293cf3
  13. MarcoFalke force-pushed on Sep 25, 2016
  14. MarcoFalke commented at 8:07 am on September 26, 2016: member
    (trivial rebase)
  15. laanwj merged this on Sep 26, 2016
  16. laanwj closed this on Sep 26, 2016

  17. laanwj referenced this in commit ab0b411868 on Sep 26, 2016
  18. morcos commented at 12:03 pm on September 26, 2016: member
    @laanwj I was about to comment but wanted to test first. Doesn’t his make setting a minrelaytxfee of 0 possible whereas it previously wasn’t? That might be OK but just wanted to point it out.
  19. laanwj commented at 12:19 pm on September 26, 2016: member

    Doesn’t his make setting a minrelaytxfee of 0 possible whereas it previously wasn’t?

    This is in fact the case, good catch. Not sure if this is a problem, but I don’t think it was intended.

  20. MarcoFalke deleted the branch on Sep 26, 2016
  21. codablock referenced this in commit 576a992597 on Sep 19, 2017
  22. codablock referenced this in commit d87c156f19 on Jan 11, 2018
  23. andvgal referenced this in commit 0205c52220 on Jan 6, 2019
  24. DrahtBot 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-19 03:12 UTC

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