Giter Club home page Giter Club logo

Comments (10)

jrick avatar jrick commented on June 14, 2024

It's not wrong. We treat your own change outputs no differently than any other change output.

The UI/API kinda sucks, yes. It would be nice to distinguish between the two. But when you send using minconf=1 (the default), those change outputs are not used.

from dcrwallet.

richiela avatar richiela commented on June 14, 2024

How is it not wrong? If i have 25 coins.. i send 2 coins... i do a getinfo.. .my balance tells me i have 0 balance. It should tell me i have 23 balance. Are you suggesting that I have to wait X number of blocks before I can check my balance to get an accurate read?

from dcrwallet.

jrick avatar jrick commented on June 14, 2024

If you have 1 UTXO with 25 output value, and you spend it sending 2 coins elsewhere and 23 coins back to yourself as a change output (let's ignore fees for simplicity), those 23 coins are not confirmed. They can be spent again with minconf=1 once they are mined in a block.

Use getbalance accountname 0 to show your unconfirmed balance, or sendfrom accountname addr amount 0 to spend unconfirmed coins.

from dcrwallet.

richiela avatar richiela commented on June 14, 2024

this deviates from bitcoin behavior. btc will always report change back to you from you as part of your balance. is there a way to get a 0 conf balance from the wallet?

from dcrwallet.

chappjc avatar chappjc commented on June 14, 2024

@richiela I believe you are looking for getbalance accountname minconf balancetype. The treatment of balancetype is here. The help description for getbalance states

"getbalance-balancetype": "The type of balance to return, 'spendable', 'locked', 'all', or 'fullscan'"

I think this is what you are after. For example getbalance default 0 all. The default type is spendable.

from dcrwallet.

richiela avatar richiela commented on June 14, 2024

That doesn't work either... get balance default 0 all returns the same thing as getinfo.

from dcrwallet.

codyf86 avatar codyf86 commented on June 14, 2024

This RPC command is also ignoring the specified account and returning the value for the total wallet, just like purchasetickets and the other RPC commands listed in issues.

--wallet getbalance default 256 spendable
13.3819809

There is 13.xx dcr spendable in the total wallet, but 0 spendable in default account atm and it still returns the total spendable.

from dcrwallet.

richiela avatar richiela commented on June 14, 2024

Is there any update on this? we need a way to send a payment, and then check the the balance to ensure it is accurate.

from dcrwallet.

cjepson avatar cjepson commented on June 14, 2024

Use 'get balance default 0 spendable' NOT 'get balance default 0 all'. There's a bug in the 'all' flag that needs to be fixed. See #2

from dcrwallet.

cjepson avatar cjepson commented on June 14, 2024

getbalance should be fixed in #104.

from dcrwallet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.