qt: Add option to (not) spend unconfirmed change #3676

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2014_02_gui_nospendzeroconfchange changing 4 files +101 −47
  1. laanwj commented at 9:46 AM on February 15, 2014: member
    • Add a wallet tab to options dialog
    • Move fee setting to wallet tab
    • Add new setting to set -spendzeroconfchange from UI

    spend-unconfirmed-gui

    Implementation is straightforward, messages are up for discussion as usual.

  2. BitcoinPullTester commented at 10:24 AM on February 15, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/341b993ca1fe6a6c247a4ed129d39fb4936668fe for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  3. christophebiocca commented at 5:57 PM on February 15, 2014: none

    Nit about the wording:

    If you disable the spending of unconfirmed change, your transaction cannot be completed until your previous transactions have at least one confirmation. This also affects how your balance is computed.

    Isn't that a little pessimistic? I mean in practice, a wallet will have multiple outputs to use, only a few of which will be used by any single transaction. How about:

    If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.

    Of course, the problem with that a user may not understand the concept of change outputs, since that is hidden from them.

  4. int03h commented at 6:27 PM on February 15, 2014: none

    Think of this in the real world.

    Spending something you don’t have is obviously not possible. So why not simply say the following:

    ADVANCED:

    [ ] Allow spending of unconfirmed changed.

    (leaving the flag off by default).

    You are not going to explain this adequately in 5 lines or less – especially to nubs .. so why bother ? Let them that wish to use it, RTFM some and then its caveat emptor if they flip it on.

  5. dgenr8 commented at 12:29 AM on February 16, 2014: contributor

    This looks to be the first mention of "change" period. A rational user will think it relates to change returned by recipient for amount paid over some agreed-on price, which further confuses, since no such prices are known by bitcoin-qt.

    The question is what should the message say, given the abstractions user is working with? That is a tough one.

  6. in src/qt/optionsmodel.cpp:None in 341b993ca1 outdated
      75 | @@ -76,6 +76,11 @@ void OptionsModel::Init()
      76 |      nTransactionFee = settings.value("nTransactionFee").toLongLong(); // if -paytxfee is set, this will be overridden later in init.cpp
      77 |      if (mapArgs.count("-paytxfee"))
      78 |          strOverriddenByCommandLine += "-paytxfee ";
      79 | +
      80 | +    if (!settings.contains("bSpendZeroConfChange"))
      81 | +        settings.setValue("bSpendZeroConfChange", true);
      82 | +    if (!SoftSetArg("-spendzeroconfchange", itostr(settings.value("bSpendZeroConfChange").toBool()))) // use itostr here, as argument parser doesn't understand true/false
    


    Diapolo commented at 1:08 AM on February 16, 2014:

    I wonder, why this is needed, we didn't have to use this before right? E.g. settings.value("fUseUPnP").toBool()...

    Shouldn't this be SoftSetBoolArg()?

  7. Diapolo commented at 1:14 AM on February 16, 2014: none

    If this also affects, how we compute the wallet balance, perhaps name the option Treat unconfirmed change as confirmed (experts only). And append (experts only), because it is similar complex for normal users like coin control IMHO and you need some knowledge of what you are doing.

    To go further, we should also rework the descriptive string for the command line option, because this misses also that using that options or disabling it will affect how balance is computed. IMHO it could be the same string with (experts only) left out.

    I also like @christophebiocca's suggestion for a less dramatic wording. As unused change won't block a transaction, it just won't allow using the change in new transactions, right?

  8. KF-R commented at 1:20 AM on February 16, 2014: none

    That wording makes a lot of sense (Diapolo).

  9. laanwj commented at 8:13 AM on February 16, 2014: member

    Will switch to @christophebiocca's wording and SetSoftBoolArg and add (experts only) like for coin control.

  10. qt: Add option to (not) spend unconfirmed change
    - Add a wallet tab to options dialog
    - Move fee setting to wallet tab
    - Add new setting to set -nospendzeroconfchange from UI
    29d45073c9
  11. laanwj referenced this in commit 25d816110b on Feb 16, 2014
  12. laanwj merged this on Feb 16, 2014
  13. laanwj closed this on Feb 16, 2014

  14. in src/qt/forms/optionsdialog.ui:None in 29d45073c9
     210 | +        </widget>
     211 | +       </item>
     212 | +       <item>
     213 | +        <widget class="QCheckBox" name="spendZeroConfChange">
     214 | +         <property name="text">
     215 | +          <string>Spend unconfirmed change  (experts only)</string>
    


    Diapolo commented at 12:32 PM on February 16, 2014:

    You added 2 spaces here ^^.

  15. Diapolo commented at 12:33 PM on February 16, 2014: none

    Why did you decide agains Spend unconfirmed change (experts only)? IMO Spend unconfirmed change (experts only) is not the whole truth (even more true for just the command line option), as it changes how we compute the balance...

  16. laanwj commented at 1:10 PM on February 16, 2014: member

    @Diapolo Don't change the name of the command line option because people are relying on it in production. Feel free to send pulls for improvements to the UI message though...

    Also: it affects coin selection primarily. The reason it also affects the balance computation is because otherwise you cannot trust that the (confirmed) balance is really how much you can spend.

  17. Diapolo commented at 2:31 PM on February 16, 2014: none

    @laanwj Don't get it, if it affects balance computation (the reason why doesn't even matter, it's just the fact), then it has to be mentioned in the help message. The reason to not change the command line message is also unclear still... it is in an unreleased branch (no official client released with it), why can't we just use Treat unconfirmed change as confirmed?

    I know you will tell me we have bigger problems to solve, but this is something I fell is important enought ;).

  18. sipa commented at 2:45 PM on February 16, 2014: member

    Maybe unconfirmed balance should just be "balance" (it's the amount of money you're reasonably sure about you have, assuming it doesn't count -1 confirmed coins), and confirmed balance should be "spendable balance". The latter can then be affected by the setting of whether to consider unconfirmed change as spendable.

  19. int03h commented at 3:46 PM on February 16, 2014: none

    Armory uses the words : Maximum Funds / Unconfirmed Fund and Spendable and shows 3 balances. One of the many reasons I use Armory. (this is not an advert for Armory - just a suggestion )

  20. laanwj commented at 4:26 PM on February 16, 2014: member

    @sipa That would make sense indeed. "Confirmed balance" has always been "Spendable balance". But "Unconfirmed balance" would then be "Unspendable balance"? @int03h Bitcoin-qt also shows 3 (or even 4, if you have immature transactions) balances: Confirmed, Unconfirmed, Immature and Total.

  21. laanwj commented at 5:25 PM on February 16, 2014: member

    @diapolo I'm doubtful about that because "Treat unconfirmed change as confirmed" doesn't really tell much. It creates a categorical confusion much like #3662 was aimed at solving (in the API we now call transactions that count toward spendable balance "Trusted" instead). Saying that it is spendable/unspendable at least tells you what you can do with it. But then the names of the balances need to be changed too.

  22. sipa commented at 5:57 PM on February 16, 2014: member

    Yeah, if you're treating unconfirmed change as confirmed, the meaning of the word confirmed becomes blurry.

    To answer the question "how much money will I (likely) (eventually) have", the current "unconfirmed balance" (excluding conflicted/noninmempool transactions) seems the correct measurement. I guess that should also include immature coins. Maybe it could be called "Eventual balance" ?

  23. laanwj commented at 6:21 PM on February 16, 2014: member

    Well currently it looks like this

    balances

    Instead of the three groups I suppose we could also make a tally like this (rows only shown if the balance is >0):

    Spendable                       XXX BTC
    Spendable after 1 block         XXX BTC (=unconfirmed balance)
    Spendable after XXX blocks      XXX BTC (=immature balances)
    ....
    ------------------------------------------------------
    Eventual total                  XXX BTC
    

    Edit: eh no that's no good either, one of course cannot be sure that the unconfirmed balance will confirm in 1 block...

  24. laanwj referenced this in commit 5de9e8712f on Feb 18, 2014
  25. laanwj referenced this in commit ddcabae0de on Feb 19, 2014
  26. laanwj deleted the branch on Apr 9, 2014
  27. MathyV referenced this in commit 9d07cb53c3 on Oct 27, 2014
  28. 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: 2026-04-13 18:16 UTC

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