bitcoin/bitcoin — pull request #1991 by znort987 (2012-11-06 14:44:55+00:00)
Title: Fixwalletdates

Add the fixwalletdates RPC

When the client has been off for a while and gets restarted,
new transactions are received via blockchain updates and get
tagged with the current time, which bear little to no correlation
with the time at which the TX was broadcast by the sender.

As a substitute, the "fixwalletdates" RPC re-tags all wallet
transactions with the timestamp of the block they are included
in (if any).

One minor downside of calling this RPC is that TX that were
actually received via broadcast will see their "broadcast date"
be replaced by the time they got included in a block.

In practice, I've found this not to be a problem. In fact,
seeing all TXs tagged with the time at which they get included
in the blockchain makes more sense : in a way, it's the time the
TX became valid, and if we have to pick one canonically representative
time for a TX, first block inclusion time is better than first
broadcast time.