Bitcoin Forum
November 06, 2024, 12:03:41 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [BOUNTY] Really annoying balance issue  (Read 1665 times)
davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
May 17, 2012, 01:10:37 PM
Last edit: May 17, 2012, 05:05:32 PM by davout
 #1

Code:
$ ./bitcoin getinfo
{
    "version" : 60099,
    "protocolversion" : 60000,
    "walletversion" : 60000,
    "balance" : 62.10626016,
    "blocks" : 180481,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 1733207.51384839,
    "testnet" : false,
    "keypoololdest" : 1337234612,
    "keypoolsize" : 1001,
    "paytxfee" : 0.00000000,
    "errors" : "URGENT: upgrade required, see http://bitcoin.org/dos for details"
}

(Gonna do the upgrade later, don't think it has anything to do with my problem.)

Code:
$ ./bitcoin getbalance '*' 0
1810.91340447

$ ./bitcoin getbalance '*' 1
1776.64506472

The correct value should be the one that getbalance yields.
What could be happening here ?? This is driving me seriously crazy.

randomproof
Member
**
Offline Offline

Activity: 61
Merit: 10


View Profile
May 17, 2012, 02:57:02 PM
 #2

It seems that you are just using the 'getbalance' command wrong, don't put "'*' 0" at the end.

like this:
bitcoin getbalance


You might be missing transactions so try running:
bitcoin -rescan
then:
bitcoin listaccounts



Donations to me:   19599Y3PTRF1mNdzVjQzePr67ttMiBG5LS
davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
May 17, 2012, 03:08:31 PM
 #3

It seems that you are just using the 'getbalance' command wrong, don't put "'*' 0" at the end.

like this:
bitcoin getbalance


You might be missing transactions so try running:
bitcoin -rescan
then:
bitcoin listaccounts
I did rescan a couple of times already, and I'm using the getbalance command correctly.
But thank you for showing some interest, it is appreciated Smiley

EDIT : Using listaccounts is a good suggestion actually, gives some more insight, results posted below

davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
May 17, 2012, 03:19:22 PM
 #4

Code:
$ ./bitcoin getinfo
{
    "version" : 60099,
    "protocolversion" : 60000,
    "walletversion" : 60000,
    "balance" : 698.57338016,
    "blocks" : 180489,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 1733207.51384839,
    "testnet" : false,
    "keypoololdest" : 1337242670,
    "keypoolsize" : 1001,
    "paytxfee" : 0.00000000,
    "errors" : "URGENT: upgrade required, see http://bitcoin.org/dos for details"
}

$ ./bitcoin getbalance
698.57338016

$ ./bitcoin getbalance '' 0
2883.11218472

$ ./bitcoin getbalance '' 1
2413.11218472

$ ./bitcoin listaccounts
{
    "" : 2413.11218472
}

$ ./bitcoin getbalance '*' 0
2883.11218472

$ ./bitcoin getbalance '*' 1
2413.11218472

Ok, so what I conclude is the following : there is apparently a bug in getbalance (called without additional arguments), that prevents it from reporting the correct balance. I assume that calling getbalance and passing an account yields the correct balances (I track them separately in a RDBMS).

Since I don't use accounts getbalance '' X and getbalance '*' X logically yield the same result.

This is very frustrating, if it is confirmed to be a bug in bitcoind (I suspect it's linked with this bug) then I think its priority should be bumped a fair bit since it prevents sending valid funds.

Any insight, idea or suggestion from the friendly Bitcoin community will be very appreciated!

davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
May 17, 2012, 04:59:48 PM
 #5

I'll bounty 2 BTC for a workaround and 10 BTC for a fix.

Bitsky
Hero Member
*****
Offline Offline

Activity: 576
Merit: 514


View Profile
May 17, 2012, 05:30:12 PM
 #6

I can't really offer a fix, but I ran into the same problem: https://bitcointalk.org/index.php?topic=81473.0

Perhaps it's possible to narrow down the cause. For me, the bug appeared when I played around with im/exporting keys. Everything was perfectly fine until the client picked up confirmations for the "to self" transaction.

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
randomproof
Member
**
Offline Offline

Activity: 61
Merit: 10


View Profile
May 17, 2012, 09:00:30 PM
 #7

Looking at the code a little, it might be possible that you have unconfirmed transactions.  Did you delete all the transactions in the wallet before rescanning?

If it is not that, then I'm lost.

Donations to me:   19599Y3PTRF1mNdzVjQzePr67ttMiBG5LS
Mushroomized
Legendary
*
Offline Offline

Activity: 1470
Merit: 1002


Hello!


View Profile
May 17, 2012, 09:18:12 PM
 #8

Update it, and rescan for transactions. If that doesn't work try using a new wallet all together

hi
davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
May 18, 2012, 08:20:42 AM
 #9

Looking at the code a little, it might be possible that you have unconfirmed transactions.  Did you delete all the transactions in the wallet before rescanning?

If it is not that, then I'm lost.
I do not, the balance reported by "getbalance '*' 1" is much bigger than what getbalance reports (the calls should theoretically be equivalent), that means the transactions counted have at least one conf.
It's logical that "getbalance '*' 0" reports a bigger balance than "getbalance '*' 1" though.

Update it, and rescan for transactions. If that doesn't work try using a new wallet all together
Update is irrelevant, rescan was done long before I even thought about posting on the forums, using a new wallet implies that I can transfer the coins which the client won't let me do since it will check what I try to send against getbalance (it won't let me transfer all the coins)

Bitsky
Hero Member
*****
Offline Offline

Activity: 576
Merit: 514


View Profile
May 18, 2012, 08:38:25 AM
 #10

using a new wallet implies that I can transfer the coins which the client won't let me do since it will check what I try to send against getbalance (it won't let me transfer all the coins)
You can create a new, empty wallet and use eg pywallet to extract the private keys from your old wallet and import them into your new wallet. Try it with just a few keys (or one only) first, use that temporary wallet with a rescan and send the coins to another new wallet.

Should work to get around this problem; however, a fix of the source to avoid that would be nice.

Also, not seeing the source/destination address in a transfer to yourself is not helpful either.

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
jojkaart
Member
**
Offline Offline

Activity: 97
Merit: 10


View Profile
May 18, 2012, 08:57:46 AM
 #11

davout, it appears people aren't receiving all the bitcoins they're supposed to. Could it be related to this problem? http://www.reddit.com/r/Bitcoin/comments/ts6ak/instawallet_lost_5_of_my_deposit/

davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
May 18, 2012, 09:15:56 AM
 #12

You can create a new, empty wallet and use eg pywallet to extract the private keys from your old wallet and import them into your new wallet. Try it with just a few keys (or one only) first, use that temporary wallet with a rescan and send the coins to another new wallet.
That's exactly what I did to create this wallet, I took a big bunch of keys, imported them all, and then let the client download/scan the chain.
I very strongly suspect the issue is somehow related to imported keys (as opposed to those generated directly by the client).

davout, it appears people aren't receiving all the bitcoins they're supposed to. Could it be related to this problem? http://www.reddit.com/r/Bitcoin/comments/ts6ak/instawallet_lost_5_of_my_deposit/
That can happen when the site is down for maintenance, bitcoind receives the coins, but the part where it notifies the backend DB doesn't work. What I usually do in these cases is force a rescan of the events that happened during the time the backend was offline.

Thank god most people aren't like the person posting this reddit thread and don't start spreading FUD if don't get an instantaneous reply from the support.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!