Skip to content

Commit b17d944

Browse files
committed
[Cashtab] Fallback to block time if timeFirstSeen is zero
Summary: T2806 If chronik has not seen a tx, timeFirstSeen will be zero and Cashtab will parse the tx as having been sent in 1970. Fall back to blocktime in this case to get a mostly accurate time estimate. Test Plan: Ping me on Telegram for a wallet seed with some txs in this category Import at cashtab.com and note wrong dates `npm start` and confirm accurate dates Reviewers: #bitcoin_abc, emack Reviewed By: #bitcoin_abc, emack Differential Revision: https://reviews.bitcoinabc.org/D12648
1 parent 98b7db8 commit b17d944

File tree

1 file changed

+4
-1
lines changed
  • web/cashtab/src/components/Home

1 file changed

+4
-1
lines changed

web/cashtab/src/components/Home/Tx.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,10 @@ const Tx = ({
437437
const handleShowMessage = () => {
438438
setDisplayedMessage(!displayedMessage);
439439
};
440-
const txDate = formatDate(data.timeFirstSeen, navigator.language);
440+
const txDate =
441+
data.timeFirstSeen !== '0'
442+
? formatDate(data.timeFirstSeen, navigator.language)
443+
: formatDate(data.block.timestamp, navigator.language);
441444

442445
// A wallet migrating from bch-api tx history to chronik will get caught here for one update cycle
443446
let unparsedTx = false;

0 commit comments

Comments
 (0)