Use block time for wallet transactions found in rescan #1159
pull sipa wants to merge 1 commits into bitcoin:master from sipa:rescantime changing 2 files +8 −5-
sipa commented at 4:26 pm on April 28, 2012: memberInstead of rescan time.
-
Use block time for wallet transactions found in rescan 30e2bfdbe9
-
luke-jr commented at 5:49 pm on April 28, 2012: memberDuring normal 24/7 operation, the first-seen time is still used, right?
-
sipa commented at 8:59 pm on April 28, 2012: memberthe behaviour with this patch would be: transactions first seen in a “tx” message or self-generated get clock time, transactions first seen in a block or found by rescanning: block time.
-
luke-jr commented at 9:22 pm on April 28, 2012: memberIt’s problematic if transactions can be “timed” older than the most recent wallet transaction, or in the future. Doing so would make “listtransactions” out of order (or worse, reordered).
-
gmaxwell commented at 9:58 pm on April 28, 2012: contributorIn general I prefer this behavior to the current one… though txn appearing ‘out of order’ in the transaction history is unfortunate. … but traditional banking sites do that all the time and people seem to survive.
-
luke-jr commented at 10:55 pm on April 28, 2012: member
I’d mind less if they actually appeared out of order, but I’m pretty sure they’re sorted by time, so they’ll reorder. :/
I care less, if listtransactions shows all 3 times (seen, block, and “best guess”) and sorts by seen time…
-
ghost commented at 5:26 am on May 9, 2012: none
Why not do it this way, without changing function args list:
0diff --git a/src/wallet.cpp b/src/wallet.cpp 1index 9989098..defab00 100644 2--- a/src/wallet.cpp 3+++ b/src/wallet.cpp 4@@ -322,7 +322,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) 5 CWalletTx& wtx = (*ret.first).second; 6 wtx.BindWallet(this); 7 bool fInsertedNew = ret.second; 8- if (fInsertedNew) 9+ if (fInsertedNew && wtx.nTimeReceived == 0) 10 wtx.nTimeReceived = GetAdjustedTime(); 11 12 bool fUpdated = false; 13@@ -397,6 +397,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl 14 if (fExisted || IsMine(tx) || IsFromMe(tx)) 15 { 16 CWalletTx wtx(this,tx); 17+ wtx.nTimeReceived = pblock->GetBlockTime(); 18 // Get merkle branch if transaction was found in a block 19 if (pblock) 20 wtx.SetMerkleBranch(pblock);
-
gmaxwell commented at 2:43 am on May 18, 2012: contributorCan we get some more discussion here? Agreement on this would be nice.
-
luke-jr commented at 2:50 am on May 18, 2012: member
We discussed this a bit back in December. I think having all 3 times (received, block, and “smart”) in JSON-RPC and just the smart times in Bitcoin-Qt is the best solution.
0"time": smart timestamp, 1"receivetime": timestamp, 2"blocktime": timestamp,
-
gmaxwell commented at 4:29 am on May 18, 2012: contributorThats sounds good to me— perhaps a later commit can make a tooltip show the three times in the gui? I assume that recievetime would be a sent time for txn you sent (being that you received them the same instant)?
-
luke-jr commented at 5:15 am on May 18, 2012: memberYes, the smart time would also logically be the sent time as well.
-
laanwj commented at 6:30 am on May 18, 2012: memberRight, we can put all the times in the “transaction details” window.
-
jgarzik commented at 3:41 pm on August 1, 2012: contributorI’m officially -ENOCARE. Code appears correct to my minimal scan. @gavinandresen ? @gmaxwell based on your comments, it sounds like you ACK this code?
-
gavinandresen commented at 3:53 pm on August 1, 2012: contributorACK. Looks obviously better than the current behavior.
-
sipa commented at 3:57 pm on August 1, 2012: member
I’m very unsure myself whether I want this merged. Luke’s version is more complex but probably behaves as expected in more use cases.
I’m not sure either should be merged without some testing…
-
gmaxwell closed this on Aug 23, 2012
-
gmaxwell commented at 8:14 pm on August 23, 2012: contributor(Obsoleted by Luke’s version.)
-
lateminer referenced this in commit fcdf663b23 on Jan 22, 2019
-
lateminer referenced this in commit 1ae53d0a2a on Dec 25, 2019
-
dexX7 referenced this in commit f473a31a7d on Aug 20, 2020
-
DrahtBot locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me