OSDN Git Service

change the ts (#284)
authorPaladz <yzhu101@uottawa.ca>
Mon, 15 Jul 2019 06:56:38 +0000 (14:56 +0800)
committerGitHub <noreply@github.com>
Mon, 15 Jul 2019 06:56:38 +0000 (14:56 +0800)
federation/synchron/sidechain_keeper.go

index 7f2f9d6..d308e14 100644 (file)
@@ -159,7 +159,7 @@ func (s *sidechainKeeper) processDepositTx(db *gorm.DB, block *types.Block, txIn
                Status:       common.CrossTxPendingStatus,
        }).UpdateColumn(&orm.CrossTransaction{
                DestBlockHeight:    sql.NullInt64{int64(block.Height), true},
                Status:       common.CrossTxPendingStatus,
        }).UpdateColumn(&orm.CrossTransaction{
                DestBlockHeight:    sql.NullInt64{int64(block.Height), true},
-               DestBlockTimestamp: sql.NullInt64{int64(block.Timestamp), true},
+               DestBlockTimestamp: sql.NullInt64{int64(block.Timestamp / 1000), true},
                DestBlockHash:      sql.NullString{blockHash.String(), true},
                DestTxIndex:        sql.NullInt64{int64(txIndex), true},
                DestTxHash:         sql.NullString{tx.ID.String(), true},
                DestBlockHash:      sql.NullString{blockHash.String(), true},
                DestTxIndex:        sql.NullInt64{int64(txIndex), true},
                DestTxHash:         sql.NullString{tx.ID.String(), true},
@@ -200,7 +200,7 @@ func (s *sidechainKeeper) processWithdrawalTx(db *gorm.DB, block *types.Block, t
        ormTx := &orm.CrossTransaction{
                ChainID:              s.chainID,
                SourceBlockHeight:    block.Height,
        ormTx := &orm.CrossTransaction{
                ChainID:              s.chainID,
                SourceBlockHeight:    block.Height,
-               SourceBlockTimestamp: block.Timestamp,
+               SourceBlockTimestamp: block.Timestamp / 1000,
                SourceBlockHash:      blockHash.String(),
                SourceTxIndex:        uint64(txIndex),
                SourceMuxID:          muxID.String(),
                SourceBlockHash:      blockHash.String(),
                SourceTxIndex:        uint64(txIndex),
                SourceMuxID:          muxID.String(),