Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: btc4ever on October 11, 2013, 01:49:28 AM



Title: Lebowskis LBW -- Balance not matching transaction history. Why?
Post by: btc4ever on October 11, 2013, 01:49:28 AM
So I have been mining some LBW from time to time.  Always solo mining. Never any send/receive transactions.  Today I noticed that the reported balance is substantially lower than the sum of the "generate" transactions when I call listtransactions. 

  reported balance: 3822.56
  sum of 'generate' transactions: 7509

( I computed the sum of transactions by calling listtransactions '' 1000, then parsing the output into a CSV file and filtering out everything that is not category "generate", then summing. )

So this seems like a bug to me, but maybe there is another explanation?

i did notice that at one point lebowskid was using a lot of CPU and the stake value became non-zero, and it was generating some transactions, which I thought was odd, but figured it was all part of the proof-of-stake logic.  But now "stake" value is zero again, and the only two transactions types in history are "generate" and "orphan".

A few more details below.

Quote
./lebowskisd getinfo
{
    "version" : "v1.1.0.0-g32a928e-dude-abides",
    "protocolversion" : 65000,
    "walletversion" : 60000,
    "balance" : 3822.56000000,
    "newmint" : 0.00000000,
    "stake" : 0.00000000,
    "blocks" : 105033,
    "moneysupply" : 2076600.75851100,
    "difficulty" : 0.13767134,
    "testnet" : false,
    "keypoololdest" : 1374466971,
    "keypoolsize" : 102,
    "paytxfee" : 0.00100000,
    "errors" : ""
}

Quote
./lebowskisd listtransactions '' 1000 | grep generate | grep categ | wc -l
393

./lebowskisd listtransactions '' 1000 | grep orphan | grep categ | wc -l
17

./lebowskisd listtransactions '' 1000 | grep amount | grep 19.98 | wc -l
197

./lebowskisd listtransactions '' 1000 | grep amount | grep 20.0 | wc -l
174

./lebowskisd listtransactions '' 1000 | grep amount | grep -v 19.98 | wc -l
213

./lebowskisd listtransactions '' 1000 | grep amount | sort -u
        "amount" : 10.00000000,
        "amount" : 10.01000000,
        "amount" : 19.98000000,
        "amount" : 19.99000000,
        "amount" : 20.00000000,
        "amount" : 20.01000000,
        "amount" : 20.02000000,

./lebowskisd listtransactions '' 1000 | grep amount | grep 10.0 | wc -l
86







Title: Re: Lebowskis LBW -- Balance not matching transaction history. Why?
Post by: aa on October 11, 2013, 03:57:23 AM
I can only imagine that you mined a bunch of orphans when this coin was first released because I can't see it being possible to get orphans when you're the only person mining a dead shitcoin.


Title: Re: Lebowskis LBW -- Balance not matching transaction history. Why?
Post by: btc4ever on October 11, 2013, 04:02:26 AM
Ok, I wrote a little php script to make it easier to get the transaction totals by category.  Script is below.  I also tried it with 7 other altcoins both scrypt and sha256 based, all POW.  All of them matched the balance correctly.

So I am thinking this is either a POW/POS thing I don't understand yet (likely), or else lebowskicoind has a pretty serious bug.

Can someone with PPCoin or some other POW/POS coins please try my script below and report your findings?  thanks.

Quote
$ ./lebowskisd listtransactions '' 100000 | sum_transactions.php

Array
(
    [generate] => 7638.8800000001
    [generate_count] => 394
    [orphan] => 339.88
    [orphan_count] => 17
)
lebowskicoin@miner1:~/lebowskicoin/src$ ./lebowskisd getbalance
3822.57000000


Here is the sum_transactions.php script
Quote
#!/usr/bin/env php

<?php

$fh = STDIN;

$buf = stream_get_contents( $fh );

$data = json_decode( $buf );

$amounts = array();
foreach( $data as $trans ) {
        if( @$trans->amount ) {
                if( @$amounts[$trans->category] ) {
                        $amounts[$trans->category] += $trans->amount;
                        $amounts[$trans->category . '_count'] += 1;
                }
                else {
                        $amounts[$trans->category] = $trans->amount;
                        $amounts[$trans->category . '_count'] = 1;
                }
        }
}
print_r( $amounts );


Title: Re: Lebowskis LBW -- Balance not matching transaction history. Why?
Post by: btc4ever on October 11, 2013, 04:05:39 AM
But the orphans should be detected as not on longest chain and marked orphan, no?

I restarted the daemon with -rescan just in case, but it still gives the same balance as before.

I can only imagine that you mined a bunch of orphans when this coin was first released because I can't see it being possible to get orphans when you're the only person mining a dead shitcoin.


Title: Re: Lebowskis LBW -- Balance not matching transaction history. Why?
Post by: aa on October 11, 2013, 04:07:30 AM
You're mining a coin that's been forking its chain for who knows how long. You probably mined a bunch of coins on the 'wrong' chain.

Update your client, if you haven't already, and forget about the inconsistencies.


Title: Re: Lebowskis LBW -- Balance not matching transaction history. Why?
Post by: btc4ever on October 11, 2013, 06:06:54 AM
The client is updated from github and freshly compiled as of a day or two ago and is fully caught up with the blockchain.  Presently has 3 peers.

dead coin or not, "wrong" chain or not, I do not see why there should be an inconsistency between the balance and the generated transactions.  As I understand it, if I was on a bogus chain and rejoin the longer correct chain, then a re-org should take place and the transactions from the wrong chain should become orphans at that point.

Clearly this did not happen.  Which makes me wonder: is there a bug in the reorg code?  somewhere else?

Or is my understanding of how this should work incorrect / incomplete?

You're mining a coin that's been forking its chain for who knows how long. You probably mined a bunch of coins on the 'wrong' chain.

Update your client, if you haven't already, and forget about the inconsistencies.