Major discrepency between ppcoind balances

Hello,

I run Bittylicious and it looks like ppcoind is in a very confused state, making Peercoin unavailable. Any urgent assistance would be appreciated.

I have a user that just bout about 143 Peercoins. I use the old accounting system (I know, I know) but balances seem to be really messed up at the moment.

ppcoin@server:~$ ppcoind getbalance “BL Seller X”
145.38585400
ppcoin@server:~$ ppcoind sendfrom “BL Seller X” “PNTMVoFdrND3edeKxxWeacKZruNNbATX2R” 143
error: {“code”:-4,“message”:“Insufficient funds”}

ppcoin@server:~$ ppcoind getbalance
93.44725500
ppcoin@server:~$ ppcoind listaccounts
{
“” : 199.83000000,
“BL Offer a” : 0.00000000,
“BL Seller a” : 6.57844900,
"BL Seller X : 145.38585400,
“BL Seller b” : 0.00000000,
“BL Seller c” : 0.00000000,
“BL Seller d” : 129.66198600,
“BL Seller e” : 32.03831400,
“BL Seller f” : -0.01000000,
“BL Seller g” : 0.05329900,
“BL Seller h” : 156.03710900,
“BL Seller i” : 0.30877400,
“Me” : 23.06347000,
“Users” : 0.00000000
}

Have you got any idea why the overall wallet balance could be so different?

ppcoind getinfo
{
“version” : “v0.4.0.0-g613a559-beta”,
“protocolversion” : 60004,
“walletversion” : 60000,
“balance” : 93.44725500,
“newmint” : 0.00000000,
“stake” : 0.00000000,
“blocks” : 124814,
“moneysupply” : 21594329.69632400,
“connections” : 8,
“proxy” : “”,
“ip” : “a.b.c.d”,
“difficulty” : 137723601.16148072,
“testnet” : false,
“keypoololdest” : 1395344013,
“keypoolsize” : 101,
“paytxfee” : 0.01000000,
“errors” : “”
}

I am not exactly sure but I think you might be seeing a well known “feature” of satoshi wallets with accounts. It has something to do with the default accound to send coin from. All I can suggest is using Peerunity as a drop-in replacement with the official wallet. Peerunity has coincontrol. You see exactly where every coin is, and can select which coin to send, where the change goes.

Thanks, but I don’t think that’s the issue here. I only use sendfrom which specifies the account to send from. As you can see, the default account is actually in credit by almost 200 PPC. It’s worth noting that we use accounts with bitcoind and it works just fine.

In any case, surely the balances should at least match?

There is a bug in the listaccounts code that overreports the balance. The correct total balance is reported by getbalance. The individual balance of each account is over-reported. I will post a patch for the fix.

This problem affects listaccounts and getbalance . getbalance without specifying account name is not affected (that shows the correct wallet total balance). That is, the impact is limited to the use of multiple account feature of bitcoin. Also the problem is limited to the display of account balances, wallet itself is not impacted.

I have picked glv’s fix of this issue into the master branch (v0.4) of peercoin:

If you can build yourself check to see if it fixes your problem. Also, peerunity v0.1.0 includes this fix.

Remember to always backup wallet before switching client.

Hi,

Thanks for that. I’ve patched the stable 0.4 version to just include those fixes to wallet.cpp. I now see:

ppcoin@bittyback:~/ppcoin-0.4.0ppc-patched/src$ ./ppcoind listaccounts
{
“” : -399.67000000,
“BL Offer a” : 0.00000000,
“BL Seller b” : 6.57844900,
“BL Seller X” : 169.29428800,
“BL Seller c” : 0.00000000,
“BL Seller d” : 0.00000000,
“BL Seller e” : 129.66198600,
“BL Seller f” : 32.03831400,
“BL Seller g” : -0.01000000,
“BL Seller h” : 0.05329900,
“BL Seller i” : 156.03710900,
“BL Seller j” : 0.30877400,
“Me” : 23.06347000,
“Users” : 0.00000000
}

So it seems to have (correctly) reduced the amount of the default account. Thanks for the fix.

Now I need to see if I can reclaim the lost 600 PPC that other users seem to have been able to sell accidentally (essentially out of other users’ balances). This bit won’t be fun at all :frowning:

Hello again,

~600 coins happens to be the total amount of coins I have received from staking. I happen to have been quite lucky and generated these coins (I think).

Is there still a remaining bug where these coins aren’t getting counted in the balances when accounting is used? Or did it over-report the amount of coins generated beforehand?

This is listtransactions “” before the patch:

[ { "account" : "", "category" : "stake", "amount" : 400.77000000, "confirmations" : 19650, "blockhash" : "d60eb860f258e1fc3afead3194bbe884b8dde747528bf342c3b248eb0876f835", "blockindex" : 1, "txid" : "a283e81aee08b1a8e604cdcd7676291bf15fc5f0d9208ea90889d68112651c7d", "time" : 1396782335 }, { "account" : "", "category" : "move", "time" : 1398439267, "amount" : -400.00000000, "otheraccount" : "Bittylicious", "comment" : "" }, { "account" : "", "category" : "stake", "amount" : 199.83000000, "confirmations" : 5470, "blockhash" : "5e9191b2a1acfa91cf92e2518ec0fd093f15d3672a29df53d7d8b307045384d5", "blockindex" : 1, "txid" : "e70bf37c29e6d7f80892d7f0ebcde41f3b62ffa5e38515c89099917f6e965026", "time" : 1403978234 }, { "account" : "", "category" : "move", "time" : 1404051191, "amount" : -0.77000000, "otheraccount" : "Bittylicious", "comment" : "" } ]

and this is it after the patch was applied:

[ { "account" : "", "category" : "stake", "amount" : 0.77000000, "confirmations" : 19649, "blockhash" : "d60eb860f258e1fc3afead3194bbe884b8dde747528bf342c3b248eb0876f835", "blockindex" : 1, "txid" : "a283e81aee08b1a8e604cdcd7676291bf15fc5f0d9208ea90889d68112651c7d", "time" : 1396782335 }, { "account" : "", "category" : "move", "time" : 1398439267, "amount" : -400.00000000, "otheraccount" : "Bittylicious", "comment" : "" }, { "account" : "", "category" : "stake", "amount" : 0.33000000, "confirmations" : 5469, "blockhash" : "5e9191b2a1acfa91cf92e2518ec0fd093f15d3672a29df53d7d8b307045384d5", "blockindex" : 1, "txid" : "e70bf37c29e6d7f80892d7f0ebcde41f3b62ffa5e38515c89099917f6e965026", "time" : 1403978234 }, { "account" : "", "category" : "move", "time" : 1404051191, "amount" : -0.77000000, "otheraccount" : "Bittylicious", "comment" : "" } ]

How much would one typically expect when they get coins back from staking them?

Good to know it is fixed. We found problems when using Peerunity to test Peershares and glv fixed it for Peerunity. Maybe glv could get rewarded from peer4commit “ppcoin” project for fixing the problem and you too for reporting, helping to have the fix put to the main branch, and testing it.

p.s. it takes 520 blocks before staked coins is spendable again.

Well I can’t entirely confirm it’s fixed, as I need to get to the bottom of the stake issue.

Beforehand, it looks as though I got about 601 PPC as stake rewards. Now it’s just closer to 1 PPC.

Is this because:

[ol][li]There’s still a bug remaining[/li]
[li]Previously, ppcoind was mistakenly reporting that I had received ~600 PPC in stake rewards[/li][/ol]

This is why I need to know roughly how much would be given in a block coin generation given a certain amount of PPC being staked (let’s say around 400 PPC on average being staked).

maybe janko33 knows

[quote=“janko33, post:32, topic:2104”]Hooray I can compute stake :)))
and the number is right too[/quote]

It’s not considered a bug, the reporting in listtransactions have changed after this fix.
previously it reports the coin amount staked plus the stake reward. after this fix it reports the stake reward amount only.
It’s not a bug, but it would be better to change the category name to ‘stakemint’. It matches to the UI tx type ‘mint-by-stake’

[quote=“bittylicious, post:9, topic:2731”]Well I can’t entirely confirm it’s fixed, as I need to get to the bottom of the stake issue.

Beforehand, it looks as though I got about 601 PPC as stake rewards. Now it’s just closer to 1 PPC.

Is this because:

[ol][li]There’s still a bug remaining[/li]
[li]Previously, ppcoind was mistakenly reporting that I had received ~600 PPC in stake rewards[/li][/ol]

This is why I need to know roughly how much would be given in a block coin generation given a certain amount of PPC being staked (let’s say around 400 PPC on average being staked).[/quote]

Hi,

OK, what happened here is this:

[ol][li]I saw that I had been given a stake reward[/li]
[li]The stake reward increased “” by 400 - it wasn’t just listtransactions that shows the increase, it was the balance of the “” account[/li]
[li]I was like, “Kerching!” and moved it elsewhere[/li]
[li]This happens. It turns out I wasn’t rewarded 400 so essentially spend other customers’ money[/li][/ol]

So, a combination of misreporting of the staked coins and me spending this misreported amount resulted in the wallet real balance being much lower than was reported.

I now need to buy some more PPC. Anyone know where I can buy some from? :wink:

Thanks for your help, SunnyKing. I’m putting the patched version live shortly.

Marc