bitcoin/bitcoin — pull request #1393 by luke-jr (2012-05-28 18:55:38+00:00)
Title: Refactor times

1. Guarantee listtransactions order consistency by storing a position for each entry
2. Add "blocktime" and (for wallet transactions) "timereceived" to transaction Objects
3. Implement "smart" times according to the following logic:
- If sending a transaction, assign its timestamp to the current time.
- If receiving a transaction outside a block, assign its timestamp to the current time.
- If receiving a block with a future timestamp, assign all its (not already known) transactions' timestamps to the current time.
- If receiving a block with a past timestamp, before the most recent known transaction (that we care about), assign all its (not already known) transactions' timestamps to the same timestamp as that most-recent-known transaction.
- If receiving a block with a past timestamp, but after the most recent known transaction, assign all its (not already known) transactions' timestamps to the block time.