I had a few conflicted transactions in my wallet, so I ran:
0bitcoind -zapwallettxes=2
to delete them. After doing so, all my transactions from before January 2014 had a date of January 2014.
Upon checking the source code, I see this line in CWallet::AddToWallet()
in wallet/wallet.cpp
:
0wtx.nTimeSmart = std::max(latestEntry, std::min(blocktime, latestNow));
blocktime
is the time I want to see in my transactions, latestNow
is much bigger, and so the min()
returns the time I want, but latestEntry
is January 2014, and so that’s the time that is used for all my old transactions.
I’m not entirely clear how the Jan 2014 date is being found, since -zapwallettxes
is meant to delete all the transactions and rescan to find them again, but it seems that
0TxItems txOrdered = OrderedTxItems(acentries);
is finding a transaction from 2014, even after all transactions have been deleted.
I tried replacing the nTimeSmart = max(min()) code with this:
0wtx.nTimeSmart = std::min(blocktime, latestNow);
then re-ran with the -zap flag, and now I see the correct dates next to all of my transactions.