Set default wallet custom tx fee to minTxFee instead of zero. #5733

pull wtogami wants to merge 1 commits into bitcoin:master from wtogami:ntransactionfee_mintxfee changing 1 files +1 −1
  1. wtogami commented at 11:00 PM on February 1, 2015: contributor

    The default of zero is never correct nor desired.

    Edit Bitcoin-Qt.conf and remove "nTransactionFee" to see the effect of this change which is limited to the default value in the custom fee of the send coins dialog.

    Related question: It is additionally unclear why wallet.h contains this. Wouldn't it make more sense to define this as the min fee as well or get rid of it?

    //! -paytxfee default
    static const CAmount DEFAULT_TRANSACTION_FEE = 0;
    
  2. Set default wallet custom tx fee to minTxFee instead of zero. 2effa6ac75
  3. gmaxwell commented at 11:08 PM on February 1, 2015: contributor

    NAK. The default of zero is completely reasonable, and allows transactions to pay their way with priority where possible and available.

  4. wtogami commented at 11:20 PM on February 1, 2015: contributor

    To be more clear, this doesn't change anything that you are concerned about. The Recommended fee is used by default. This commit only changes the default value that is the custom fee which isn't used unless you manually select it.

    Additionally did you know "Send as zero-fee transaction if possible" is disabled by default in the wallet GUI? See fSendFreeTransactions

  5. gmaxwell commented at 11:23 PM on February 1, 2015: contributor

    Yep, I knew that. Still isn't obvious what you're trying to accomplish here. Can you explain the bad behavior you're trying to correct for me?

  6. wtogami commented at 11:26 PM on February 1, 2015: contributor

    Prior to the patch the custom fee box is zero which is never usable. This merely sets that value to a sane default ... which is not actually used unless you select the Custom fee radio.

    It is separately necessary to check "Send as zero-fee transaction if possible" if you really want to pay with priority, in which case both the Recommended and Custom fee are ignored.

  7. wtogami commented at 11:35 PM on February 1, 2015: contributor

    (Your concern as stated in the NAK not how the code currently operates.)

  8. wtogami commented at 11:59 PM on February 1, 2015: contributor

    NOTE: I didn't change DEFAULT_TRANSACTION_FEE, that was merely a related question.

  9. laanwj added the label Wallet on Feb 2, 2015
  10. laanwj commented at 8:30 AM on March 11, 2015: member

    Does anyone else involved with the wallet have an opinion here? @jonasschnelli @cozz?

  11. jonasschnelli commented at 10:33 AM on March 11, 2015: contributor

    @wtogami i cannot follow the intent of this PR. Could you explain more in detail whats the benefit of this change?

    Before this PR i have a std.fee of 0.01mBTC/kb: bildschirmfoto 2015-03-11 um 11 29 34

    After this PR i still have std fee of 0.01mBTC/kb. bildschirmfoto 2015-03-11 um 11 32 41

    Tend to NACK because i can't see the benefit and this might bring up new issues.

  12. laanwj added the label GUI on Mar 11, 2015
  13. fsb4000 commented at 1:04 PM on March 11, 2015: contributor

    before: before after: after At my view this PR is trivial. No new issues. ACK

  14. laanwj commented at 1:40 PM on March 11, 2015: member

    Thanks for the explanatory screens @fsb4000, that indeed seems to make sense.

  15. jonasschnelli commented at 1:49 PM on March 11, 2015: contributor

    I'm still not convinced. After looking again i see 0.00000 as default fee. I stepped to code and got false while eval settings.contains("nTransactionFee") (i use the std. config with --regtest added).

    And why there is a call to GetFeePerK() for a absolute (not per KB) fee?

    bildschirmfoto 2015-03-11 um 14 45 10

  16. fsb4000 commented at 2:04 PM on March 11, 2015: contributor

    @jonasschnelli

    And why there is a call to GetFeePerK() for a absolute (not per KB) fee?

    Actually here per KB fee: (sendcoindialog.cpp)

    CWallet::minTxFee.GetFeePerK() 
    

    (amount.h) (class CFeeRate)

    CAmount GetFeePerK() const { return GetFee(1000); } // satoshis-per-1000-bytes
    

    (amount.cpp)

    CAmount CFeeRate::GetFee(size_t nSize) const
    {
        CAmount nFee = nSatoshisPerK*nSize / 1000;
    
        if (nFee == 0 && nSatoshisPerK > 0)
            nFee = nSatoshisPerK;
    
        return nFee;
    }
    

    @jonasschnelli

    I'm still not convinced. After looking again i see 0.00000 as default fee.

    You see 0.000000 because the parameter(Qsettings) is already existed. This value changes only when you run first time. I don't know about Mac and Linux but if you delete parameter HKEY_CURRENT_USER\Software\Bitcoin\Bitcoin-Qt-testnet\nTransactionFee at Windows you'll get my result regedit

  17. gmaxwell commented at 6:31 PM on March 11, 2015: contributor

    I still don't understand this. The default fee in Bitcoin Core is zero (absent smartfee). Having to hit a bunch of buttons just to get back to zero would be annoying. I'm probably misunderstanding, but I tried to get warren to help me understand and failed. :(

  18. fsb4000 commented at 3:45 AM on March 12, 2015: contributor

    @gmaxwell

    I still don't understand this. The default fee in Bitcoin Core is zero (absent smartfee). Having to hit a bunch of buttons just to get back to zero would be annoying. I'm probably misunderstanding, but I tried to get warren to help me understand and failed. :(

    You don't need change back to zero. If you want send with zero fee you should check ui->checkBoxFreeTx (in order to fSendFreeTransactions=true) Your zero fee is ignored. The sequence:

    1. You put 0
    2. payTxFee became 0. (https://github.com/bitcoin/bitcoin/blob/master/src/qt/sendcoinsdialog.cpp#L598)
    3. You press send transaction. (https://github.com/bitcoin/bitcoin/blob/master/src/wallet.cpp#L1555)
    4. If you had "fSendFreeTransactions" then you send free(if possible) (https://github.com/bitcoin/bitcoin/blob/master/src/wallet.cpp#L1726) 5)If you didn't have "fSendFreeTransactions" then
    CAmount nFeeNeeded = GetMinimumFee(nBytes, nTxConfirmTarget, mempool); 
    

    https://github.com/bitcoin/bitcoin/blob/master/src/wallet.cpp#L1739 6)function GetMininumFee https://github.com/bitcoin/bitcoin/blob/master/src/wallet.cpp#L1818

    CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool)
    {
        // payTxFee is user-set "I want to pay this much"
        CAmount nFeeNeeded = payTxFee.GetFee(nTxBytes);
        // user selected total at least (default=true)
        if (fPayAtLeastCustomFee && nFeeNeeded > 0 && nFeeNeeded < payTxFee.GetFeePerK())
            nFeeNeeded = payTxFee.GetFeePerK();
        // User didn't set: use -txconfirmtarget to estimate...
        if (nFeeNeeded == 0)
            nFeeNeeded = pool.estimateFee(nConfirmTarget).GetFee(nTxBytes);
        // ... unless we don't have enough mempool data, in which case fall
        // back to a hard-coded fee
        if (nFeeNeeded == 0)
            nFeeNeeded = minTxFee.GetFee(nTxBytes);
        // prevent user from paying a non-sense fee (like 1 satoshi): 0 < fee < minRelayFee
        if (nFeeNeeded < ::minRelayTxFee.GetFee(nTxBytes))
            nFeeNeeded = ::minRelayTxFee.GetFee(nTxBytes);
        // But always obey the maximum
        if (nFeeNeeded > maxTxFee)
            nFeeNeeded = maxTxFee;
        return nFeeNeeded;
    }
    

    As you can see here your zero fee will be overwritten.

  19. gmaxwell commented at 3:55 AM on March 12, 2015: contributor

    As you can see here your zero fee will be overwritten.

    Yes, it will be, if you don't meet the basic criteria for relaying. I wrote that code.

    I am not trying to debate the free transaction behavior. I am trying to oppose what sound like this idea that there is some minimum fee on the bitcoin network which is something other than zero.

  20. laanwj commented at 4:10 PM on March 20, 2015: member

    I'm going to close this pull - from the discussion it looks to be controversial to change the default. The value of the QSetting in question is only used in the GUI field shown in the screenshots, and it's value is easily changed in the GUI for people that want to change it.

  21. laanwj closed this on Mar 20, 2015

  22. 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: 2026-04-21 15:15 UTC

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