Skip to content

Commit 13917ef

Browse files
Followup of BuildOnViction#806
1 parent 438e75e commit 13917ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/blockchain.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,9 +2264,10 @@ func (bc *BlockChain) logExchangeData(block *types.Block) {
22642264
for _, txMatchBatch := range txMatchBatchData {
22652265
for _, txMatch := range txMatchBatch.Data {
22662266
// the smallest time unit in mongodb is millisecond
2267-
// hence, we should update time in second
2267+
// hence, we should update time in millisecond
22682268
// old txData has been attached with nanosecond, to avoid hard fork, convert nanosecond to millisecond here
2269-
txMatchTime := time.Unix(txMatchBatch.Timestamp / 1e6, 0).UTC()
2269+
milliSecond := txMatchBatch.Timestamp / 1e6
2270+
txMatchTime := time.Unix(0, milliSecond * 1e6).UTC()
22702271
if err := tomoXService.SyncDataToSDKNode(txMatch, txMatchBatch.TxHash, txMatchTime, currentState); err != nil {
22712272
log.Error("failed to SyncDataToSDKNode ", "blockNumber", block.Number(), "err", err)
22722273
return

0 commit comments

Comments
 (0)