Balance Not Proper

Discussion in 'Balances' started by Ayush, Apr 4, 2016.

Tags:
  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. Ayush

    Ayush Full Member
    Advocate (Facebook)

    Jan 9, 2016
    512
    100
    Male
    .
    .
    Hello.
    The question I have is now to spend decred coins.
    When I run.
    --wallet getbalance"default" 0 all
    I get 15.505

    But
    --wallet getbalance"*" 0 all
    I get 297.650

    When I run
    --wallet listaccounts
    I get -
    {
    "default": 4.67562196,
    "imported": 0
    }
    The default one is not the problem as it will take time and ticket vote was over recently only.
    So How do I spend the coins shown in "*"
    I tried
    --wallet purchaseticket "*" 20 1 (Like the {--wallet purchaseticket "default" 20 1 }command )
    But I get error saying "*" account not found. So what can I do? Should I just wait for the tickets to vote?
    After tickets vote, the amount will come into "default" account?
     
  2. zero

    zero Full Member

    Jan 1, 2016
    288
    121
    Male
    #2 zero, Apr 4, 2016
    Last edited: Apr 4, 2016
    The funds you use for tickets are locked until those tickets gets voted or expired or missed/revoked and then mature and return to your spendable balance plus any reward if they get voted or not if they missed/revoked or expired (ticket fees are not returned).

    You can get your spendable balance with:

    dcrctl -u "dcrwallet_username" -P "dcrwallet_password" --wallet getbalance

    Or

    dcrctl -u "dcrwallet_username" -P "dcrwallet_password" --wallet getbalance "*" 0 spendable

    But I am quite sure in this case both commands will return you the same, so use the easiest one.
     
    Ayush likes this.
  3. Shadowlance

    Shadowlance Full Member

    Jan 9, 2016
    220
    155
    Male
    The * means 'all accounts'. Since most people will only have one (default) they become the same thing. If you created more accounts in your wallet and had funds in them, then 'default' and '*' would give different values.
     
  4. Ayush

    Ayush Full Member
    Advocate (Facebook)

    Jan 9, 2016
    512
    100
    Male
    .
    .
    Thanks for ur reply, I already know these commands. My question is where are the remaining coins located?
     
  5. Ayush

    Ayush Full Member
    Advocate (Facebook)

    Jan 9, 2016
    512
    100
    Male
    .
    .
    That's the point man
    I haven't created any other account.
    I have also posted the output of the listaccounts command. Have a look.
    Question is where are the remaining coins?
     
  6. davecgh

    davecgh Hero Member
    Developer Organizer

    Dec 31, 2015
    642
    788
    Male
    United States
    You can't spend from "*". That would totally defeat the purpose of having separate accounts which is intended to ensure that certain funds are never commingled such as what is legally required by the IRS (taxes) when you're running different businesses.

    The only way to transfer money between accounts is to do an on-chain transaction. This is similar to how it works with banks where you transfer money from one account to another and you see a debit from one account and a credit to the other account.

    Unfortunately the imported addresses currently go into a separate "imported" account due to some legacy internal architecture that requires imported addresses to be in a separate account. Ultimately, the plan is that you will be able to specify which account to import keys into.
     
  7. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    #7 drunkenmugsy, Jan 16, 2017
    Last edited: Jan 16, 2017
    OK I have a similar problem I think. Has this been resolved yet? It appears I have several hundred dcr 'stuck'. At most I would have 2 stakes @35dcr or less not in a pool right now so even that does not account for the big difference. I have consolidated. The last relevant(within 256 block) vote I had on the pool was at 98913 and 98824. These also would only be for stakes @40dcr or less. The amount in flight or solo staked still does not add up to several hundred dcr. I am at a loss as to WTF.

    Code:
    \decred>dcrctl.exe --wallet getbalance default 0 spendable
    125.85813972
    
    \decred>dcrctl.exe --wallet getbalance * 0 spendable
    445.55221932
    
    \decred>dcrctl.exe --wallet listaccounts
    {
      "default": 125.85813972,
      "imported": 0,
      "voting": 0
    }
     
  8. dhill

    dhill Moderator
    Developer Organizer

    Mar 14, 2016
    11
    21
    Male
    what does `dcrctl --wallet listaccounts 0` show?
     
  9. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    #9 drunkenmugsy, Jan 16, 2017
    Last edited: Jan 16, 2017
    I sold 125dcr in between posts so the 0.8 is correct. Trying to capture some of this market volatility...
    Code:
    \decred>dcrctl.exe --wallet getbalance * 0 spendable
    320.54470932
    
    \decred>dcrctl.exe --wallet getbalance default 0 spendable
    0.85062972
    
    \decred>dcrctl.exe --wallet listaccounts 0
    {
      "default": 0.85062972,
      "imported": 0,
      "voting": 0
    }
     
  10. dhill

    dhill Moderator
    Developer Organizer

    Mar 14, 2016
    11
    21
    Male
    does `--wallet listunspent 0` show anything interesting?
     
  11. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    It shows tons of stake tickets it looks like. What is considered interesting? There are 2 that are spendable=true under the default account. That adds up to my default spendable. They are both different addresses. The rest appear to be in the imported account for pending stake tickets. I am in a pool.

    What am I looking for?
     
  12. dhill

    dhill Moderator
    Developer Organizer

    Mar 14, 2016
    11
    21
    Male
    listaccounts should match what getbalance fullscan returns.

    Can you paste the output of these commands?
    dcrctl.exe --wallet getbalance * 0 fullscan

    dcrctl.exe --wallet getbalance default 0 fullscan

    dcrctl.exe --wallet listaccounts 0
     
  13. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    #13 drunkenmugsy, Jan 17, 2017
    Last edited: Jan 17, 2017
    \decred>dcrctl.exe --wallet getbalance * 0 fullscan
    87.98022134

    \decred>dcrctl.exe --wallet getbalance default 0 fullscan
    87.98022134

    \decred>dcrctl.exe --wallet listaccounts 0
    {
    "default": 87.98022134,
    "imported": 0,
    "voting": 0
    }

    It looks like it does. So why the discrepancy with the */default balances when using getbalance spendable and all? I understand the all may be different due to pool interaction but the spendable may be different but should be accessable? Or is it in flight? It seems to much(several hundred) to be in flight.

    \decred>dcrctl.exe --wallet getbalance default 0 all
    131.54501715

    \decred>dcrctl.exe --wallet getbalance default 0 spendable
    87.98022134

    \decred>dcrctl.exe --wallet getbalance * 0 all
    XXXX.02868671

    \decred>dcrctl.exe --wallet getbalance * 0 spendable
    407.67430094
     
  14. jrick

    jrick Member
    Developer

    Jan 4, 2016
    88
    81
    Male
    #14 jrick, Jan 17, 2017
    Last edited: Jan 17, 2017
    default and '*' don't mean the same thing, default is the (default -- you can change it) name of the first BIP0032 account (account number 0) while * means every account, including the non-BIP0032 account 'imported'.

    The "spendable" balance is the decred that is immediately spendable if you were to create a transaction from some account. All includes everything, including outputs that are not immediately spendable, either due to consensus reasons (e.g. coinbase maturity) or wallet policy (choosing not to consider some outputs spendable if they haven't reached some depth in the blockchain).

    We can definitely do better to report all of these different balances. I would be in favor of changing the RPC (or introducing a new RPC, to keep compatibility with the existing method) that reports all of these values at a time. This would remove a lot of confusion about what exactly is being reported.

    Edit: oh and also, the reason why those locked funds are part of the imported account and not from your default account is that they are spendable using an imported script, and currently due some design decisions (and/or mistakes) in dcrwallet, the 'imported' account is the only one that can hold those scripts.
     
  15. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    I think I understand what you are saying about coins not being available. I understand the difference between the default all 131dcr and the default spendable 87dcr. One voted ticket has not returned yet. I think I posted further up that their should only be 2 voted tickets(at the time, regardless, I dont have several hundred dcr in flight as far as I know) for less than 80dcr total within the 256 block window to becoming usable. As I have said where is the rest? Or what is the several hundred dcr difference seen when doing getbalance * all?
     
  16. jrick

    jrick Member
    Developer

    Jan 4, 2016
    88
    81
    Male
    I think the discrepancy is due to the voting account showing up when querying all accounts with *. See my edit.

    Is your concern that you think those funds should be returned to your default account?
     
  17. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    OK now this I am not sure I understand. Are you saying that pool staking profits coming to the import account are what is hidden? The imported account does not show a balance and I have voted pool tickets way beyond the 256 window. Please provide more detail/context.
     
  18. jrick

    jrick Member
    Developer

    Jan 4, 2016
    88
    81
    Male
    Not hidden, but they should be part of the imported "balance" until they are voted on or revoked.

    It sounds like in this particular case you are hitting some actual bug but it is still not clear exactly what went wrong and why it is being reported incorrectly. I've made a new issue https://github.com/decred/dcrwallet/issues/526 to try and improve this, so even if we don't fix the actual balance values, we can still get greater insight into the wallet and remove a lot of confusion.
     
  19. drunkenmugsy

    drunkenmugsy Sr. Member
    Advocate (Reddit)

    Dec 28, 2015
    405
    218
    Male
    I agree it would be nice to see individual pool totals from dcrctl.

    I guess I am marking this one as unresolved for now as I still dont know what the extra several hundred dcr really are and I cant manipulate or really view them.
     
  20. dhill

    dhill Moderator
    Developer Organizer

    Mar 14, 2016
    11
    21
    Male
    #20 dhill, Jan 19, 2017
    Last edited: Jan 19, 2017

Share This Page