Page MenuHomePhabricator

[token-server] Add function getTxTimestamp to get best timestamp from a chronik Tx_InNode
ClosedPublic

Authored by bytesofman on Mar 6 2024, 17:38.

Details

Summary

Add function to get best timestamp from a chronik Tx_InNode object. Use timeFirstSeen if available. If unavailable and the tx is in a block, use block timestamp. If the tx is unconfirmed and also has timeFirstSeen of 0 (unlikely edge case implying chronik just indexed and the tx is not confirmed), return -1 to denote that the timestamp is unknown.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
ts-latest-cc
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27700
Build 54963: Build Difftoken-server-tests
Build 54962: arc lint + arc unit