dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

Dash-Qt: Date in recent transactions is wrong #507

Closed schinzelh closed 6 years ago

schinzelh commented 9 years ago

I've noticed that the dates of transactions in the QT are not correct during blockchain download

image

Although my blockchain is 21 weeks behind, the transactions wobble around the current date (2015-08-11).

May be caused by "headers first" approach.

UdjinM6 commented 9 years ago

It's not "wrong" imo, it's just the whole list/wallet is "out of sync" as stated everywhere in the wallet :stuck_out_tongue: There is a bunch of stuff on sync process under the hood and wallet tries to keep off from updating GUI, reorganizing/beautifying things because it could bring a noticeable lag (updating GUI requires cs_main lock in many places for example).

schinzelh commented 9 years ago

I am not saying that the wallet should display the transactions in correct order, but at least showing the correct date from the block the tx occured. This wallet has 10000 incoming tx and all are displayed as being occured between 2015-08-09 and 2015-08-11, with changing times of day. I'll create a screen capture to show what i mean :)

schinzelh commented 9 years ago

Even after sucessful rescan the dates mismatch

image

UdjinM6 commented 9 years ago

ohhh....wow... does this persists after wallet restart?

schinzelh commented 9 years ago

Yep, it does. Maybe this is even related with "importprivkey", as all addresses have been imported into that wallet. I'll try to create a simple testcase/steps to reproduce.

schinzelh commented 9 years ago

It seems i found a rare edge case in importprivkey/rescan functionality.

These are the steps to reproduce.

Result 1:

image

http://test.explorer.dash.qa/tx/7a658a7236f3c255595bb05c6da12f2a3401537e6b2bf60b553231a314b0b7d0

Result 2:

image

http://test.explorer.dash.qa/tx/e33acc10454e57c19d5f2c8b866736bb7964a18d66b4b1e3952b983ea73d0365

So it seems the date from the first tx is leaking into the second tx during the rescan.

BTW:

If you start with a fresh wallet.dat and do

importprivkey cSPr4ikmBEsDJ6Rn1fGnU7FeJ767dLZxXm27udW8jwvQrPb3BqKg 0 false importprivkey cVq6Vt9UqgqeDSuPb2qjvxrVfbt6pPQZPQNpmnHM1SUgdP3aoHQY 0 true

without restarting the wallet you will get the correct result :)

image

schinzelh commented 6 years ago

Obsolete