Num of coins of txs is not displayed correctly in my v0.5.2ppc-beta peercoin-qt

I just installed a peercoin-qt client, 64 bit, version number v0.5.2ppc-beta, and synced with the network. I tried to make a few transactions, 3 to be exactly. I sent 1 coin from BTC-E to my wallet, twice, and sent back 0.1 coin with 0.01 transaction fee. All transactions are executed properly and accepted on the network. The account balance is correct, by number of coins showed in each transaction is totally in a mess and I don’t know why. Please refer to the attached screen shot to get some details. Could someone give me some info about what could be wrong? Thank you all.

Are you able to see any attached screen shots? I cannot find any one although I did attach them in the post.

I uploaded these screen shots to imgur.com:

firstly, upgrade to the latest version, 5.2 is out of beta.
secondly, it has been mentioned before today by ppcman,

change addresses: https://ppc.blockr.io/tx/info/20b27291be51021c2e50cadb4a4952e7f24599f206b0d85f6c9e97b2c4cd70a0

from:
PDU2AEjo7p42ioARwhe4R1WBVupBVckMqo -1.02247

to:
PSvxYGP5yu5tvwS1Ez4hUKEtdPaaJH9XVr 0.01247 change address
PRFrCZcZDh5Pu9QmsD8nYRiUfJ3cfLvZTo 1

i believe to get the change address on your address list, you could dumpprivkey and then importprivkey

[quote=“intergalactic, post:4, topic:3803”]firstly, upgrade to the latest version, 5.2 is out of beta.
secondly, it has been mentioned before today by ppcman,

change addresses: https://ppc.blockr.io/tx/info/20b27291be51021c2e50cadb4a4952e7f24599f206b0d85f6c9e97b2c4cd70a0

from:
PDU2AEjo7p42ioARwhe4R1WBVupBVckMqo -1.02247

to:
PSvxYGP5yu5tvwS1Ez4hUKEtdPaaJH9XVr 0.01247 change address
PRFrCZcZDh5Pu9QmsD8nYRiUfJ3cfLvZTo 1

i believe to get the change address on your address list, you could dumpprivkey and then importprivkey[/quote]

Thank you very much, I will check it later. By the way, I think I downloaded the “latest” version yesterday, from the download page of peercoin.net. I will check it twice.

I downloaded the package, ppcoin-0.5.2ppc-linux.tar.gz, from peercoin.net download page, and the ‘getinfo’ command from the debug window shows the following information:


{
"version" : "v0.5.2ppc-beta",
"protocolversion" : 60006,
"walletversion" : 60000,
"balance" : ***,
"newmint" : 0.00000000,
"stake" : 0.00000000,
"blocks" : 226336,
"moneysupply" : 23044098.73142700,
"connections" : 8,
"proxy" : "",
"ip" : "218.67.157.45",
"difficulty" : 473380595.16506135,
"testnet" : false,
"keypoololdest" : 1457895181,
"keypoolsize" : 101,
"paytxfee" : 0.00000000,
"unlocked_until" : 0,
"errors" : "Info: Minting suspended due to locked wallet."
}

http://i.imgur.com/m8c2bLX.png

Is my ppcoin-qt executable the latest version?

Now I can see somehow my wallet just displays the change amount of the transaction, instead of the number of coins I received from the transaction. (quite surprised after I got so many ‘free’ coins for my first transaction :wink: ) Is it a feature, or just simply a bug? If it is a bug, then by

could you elaborate a little bit more? After I am doing that, everything will get back to normal? Thank you very much.

i dont think it s a bug, but the term wallet as introduce by satoshi is confusing for everyone.
Qt wallet has internally a pool of 100 addresses. On each tx a new address will be taken from this pool to be used as a change address.

some copy/paste from nulagoon: http://nulagoon.com/#Guide

Trouble-shooting: Strange address recovery

If a strange address is used as the first input address in your deposit transaction somehow, don’t worry. You can recover that strange address back to your control by dump and import its private key in the debug window console.

For Nubits and Bitcoin:

-show private key on screen:

Click on the menu Help / Debug window (at the top).
Click on the Console tab.
If your wallet is encrypted, type the following command followed by the Enter key to unlock the wallet
walletpassphrase (password) 600
Type the following command to export the key
dumpprivkey (peercoin address)
The private key is shown on the screen.

to import the priv key, which also results in having the address in your tabs:

importprivkey “yourveryveryveryverylongprivatekeystring” “my-new-key”

Thank you very much for your kind response. Today I started a new wallet in a new virtual machine and made some transactions and got the same issue. Is it just me or everyone else are the same? I happened to start a Litecoin wallet as the same time and everything seems to be all right. That makes me wonder…

Hi Chamme,

No it’s not just you - I believe I’m having the same issue and working to fix it as well. see - https://www.peercointalk.org/index.php?topic=4442.0

I guess it’s related to Peercoin’s avatar mode which sends change back to the send address if enabled (it’s enabled by default. set avatar=0 in conf to disable).
try disabling it with a new wallet and see if everything becomes normal.

anyway what you described is not what a normal user expect to see so I think it should be regarded as a bug? [member=31951]sunny[/member]

[quote=“mhps, post:10, topic:3803”]I guess it’s related to Peercoin’s avatar mode which sends change back to the send address if enabled (it’s enabled by default. set avatar=0 in conf to disable).
try disabling it with a new wallet and see if everything becomes normal.

anyway what you described is not what a normal user expect to see so I think it should be regarded as a bug? [member=31951]sunny[/member][/quote]

Avatar mode should not be turned on by default, there was a bug turning on avatar by default but it was fixed a while back, the fix was in b38ca3e. I will look into this issue a bit more.

I can reproduce it now.

In peerunity, the amounts are shown correctly, however in the new ppcoin-qt version with the same wallet.dat, it shows the amount of the change address instead which is not yours (the receiver) but the change address of the sender.

setting avatar=0 in the conf file did nothing, I think this is a bug.

I was forced to redownload the blockchain due to db_runrecovery fatal errors on startup, but I have a feeling the balance and stake totals are not the same too as it was in peerunity. (In peerunity, I recall I had still some at stake, here I have nothing at stake --pun unintented–)

[quote=“intergalactic, post:12, topic:3803”]I can reproduce it now.

In peerunity, the amounts are shown correctly, however in the new ppcoin-qt version with the same wallet.dat, it shows the amount of the change address instead which is not yours (the receiver) but the change address of the sender.

setting avatar=0 in the conf file did nothing, I think this is a bug.

I was forced to redownload the blockchain due to db_runrecovery fatal errors on startup, but I have a feeling the balance and stake totals are not the same too as it was in peerunity. (In peerunity, I recall I had still some at stake, here I have nothing at stake --pun unintented–)[/quote]

Excellent job narrowing it down intergalactic! I recommend sending Sunny a PM for this problem too. I’m sure a fix won’t take long.

Hi friends, excuse me for bothering you again. I happened to get yet another issue. Here is my steps of using the wallet:

1 Downloaded a wallet package, unpacked it, run the ppcoin-qt 64 bit version, synched with the network, encrypted my wallet, backed up my wallet from drop down menu command “Backup Wallet”, then made a few test transactions, as above mentioned;

2 The problem is, the next day when I restarted my Ubuntu14.04, it said some disk errors occurred and auto fixed them. After the system started, my peercoin wallet just wouldn’t load, saying bad blocks or something, so I have to copy the wallet.dat file (just in case) from ./ppcoin in my home directory to a safe location, delete all the contents in the ./ppcoin directory, then restart ppcoin-qt and re-synch with the network; The questions are:

3.1 Which wallet.dat should I use? I tried both of them, but all the same with the following steps:

3.11 All the historical transactions and balance are there, but I made a new transaction in another test wallet to send back 1.99 (with 0.01 fee) peercoins to this restored wallet. The transaction itself was accepted on the network and validated, but I cannot find this transaction in my restored wallet, even though I tried to start my wallet from a console with the command:

[code]./ppcoin-qt -rescan[/code]

3.12 I examined the transaction history of the address in my wallet using the following web service:

[url=https://ppc.blockr.io/address/info/PRFrCZcZDh5Pu9QmsD8nYRiUfJ3cfLvZTo]https://ppc.blockr.io/address/info/PRFrCZcZDh5Pu9QmsD8nYRiUfJ3cfLvZTo[/url]

and found the transaction be there, so what can I do?

3.2 During this process, I yet found another new “issue” (maybe it’s not): my address balance is only 2 peercoin! After a detailed examination, I guess the wallet must be generating a new address, and sent the change to that new address, right? So:

3.21 Where can I find this new address in my wallet or should I? and,

3.22 If I use the original backed up wallet file (in case I happened to forget to backup the latest wallet.dat file or just the whole disk is damaged physically after wallet backup), this newly generated address will be there and my coins are still safe?

Thank you very much for your patience and kindness to answer my peculiar questions.

It appears there is a bug in the newest wallet with displaying amounts which is currently being investigated.

If you make transactions with the current wallet and see weird things (like you have), this is why. We have to wait on a fixed version.

The most important thing you need to keep track of is your wallet private keys. Unlock your wallet, and run the dumpprivkey command to output your private keys for your addresses.

Then print this out on your printer and keep them in a safe place. This is known as a “paper wallet”

This way at any time later in the future, you can take any version of a Peercoin client that syncs to the network and use the “importkey” command and re-import that key manually.

Transactions in wallet.dat are only important if you want to share a transaction that hasn’t been confirmed yet. You already confirmed your transaction, so that’s not a problem.

There are no coins stored in wallet.dat. Mostly just private keys, previously generated public wallet addresses, previously sent transactions, etc. The wallet balances are in the public block chain and that’s where coins are stored - in public on the chain.

Your private keys allow you to manipulate the public block chain and move coins.

So at the end of the day, it is only those private keys that are critical. If you hold a large balance (more than a couple hundred dollars), always have a paper wallet for safe keeping of your keys.

I only have about $200 worth of Peercoin (I wish I could buy more, and maybe I can soon), and I still guard my private key with my life by printing it on paper and putting it in my safe deposit box.

So apparently the display bug explains why you’re seeing weirdness, and I have given you a tip on how to save yourself in the event your hard drive dies. I would recommend not sending any more transactions with the latest wallet yet.

Be patient, next version with a bug fix maybe coming soon. If there is a display bug like this, usually I see them fixed in a few weeks or less.

Thank you, ppcman.

This bug only affect QT, and only affect the coin you received, and only in the Transaction List, not in details. I have located the bug
ppcoin/ppcoin/blob/master/src/qt/transactionrecord.cpp

when your qt wallet start, and scan the transactions, it will add the transactions related to your address, but in 0.5.2 version, at line 96, it only add the transaction not Generated, not belonge to myself. :<
the logic is totally fucked. below are the code

       BOOST_FOREACH(const CTxOut& txout, wtx.vout)
        {
            TransactionRecord sub(hash, nTime);
            CTxDestination address;
            sub.idx = parts.size(); // sequence number
            sub.credit = txout.nValue;
            if (wtx.IsCoinBase())
            {
                // Generated
                sub.type = TransactionRecord::Generated;
            }
            else if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))
            {
                // Received by Bitcoin Address
                sub.type = TransactionRecord::RecvWithAddress;
                sub.address = CBitcoinAddress(address).ToString();
            }
            else
            {
                TransactionRecord sub(hash, nTime);
                CBitcoinAddress address;
                sub.idx = parts.size(); // sequence number
                sub.credit = txout.nValue;
                if (wtx.IsCoinBase())
                {
                    // Generated
                    sub.type = TransactionRecord::Generated;
                }
                // else if (ExtractAddress(txout.scriptPubKey, address) && wallet->HaveKey(address))
                // {
                //     // Received by Bitcoin Address
                //     sub.type = TransactionRecord::RecvWithAddress;
                //     sub.address = address.ToString();
                // }
                else
                {
                    // Received by IP connection (deprecated features), or a multisignature or other non-simple transaction
                    sub.type = TransactionRecord::RecvFromOther;
                    sub.address = mapValue["from"];
                }

===>                parts.append(sub); //here is the bug
            }
        }

[quote=“xuyangcn, post:17, topic:3803”]This bug only affect QT, and only affect the coin you received, and only in the Transaction List, not in details. I have located the bug
ppcoin/ppcoin/blob/master/src/qt/transactionrecord.cpp

when your qt wallet start, and scan the transactions, it will add the transactions related to your address, but in 0.5.2 version, at line 96, it only add the transaction not Generated, not belonge to myself. :<[/quote]

Thank you for finding this bug xuyangcn.

Please post a PPC address and I will send a tiny amount of PPC as a tip. Maybe others might do the same.

Speaking of bugs, the wallet reports the transaction date&time as of the time of syncing rather then true transaction date&time. I have reported that like 2 years ago and it’s still not fixed; let’s hope this one will take a bit shorter than that to get corrected…

How does btc wallet behave? It would be nice if the date/time is tx time.