aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/block_validator.go3
-rw-r--r--core/evm.go7
2 files changed, 7 insertions, 3 deletions
diff --git a/core/block_validator.go b/core/block_validator.go
index 1bb6aafa2..b91981e33 100644
--- a/core/block_validator.go
+++ b/core/block_validator.go
@@ -111,8 +111,7 @@ func (v *BlockValidator) ValidateWitnessData(height uint64, blockHash common.Has
}
if b.Hash() != blockHash {
- log.Error("invalid witness block %s vs %s",
- b.Hash().String(), blockHash.String())
+ log.Error("invalid witness block", "first", b.Hash().String(), "second", blockHash.String())
return consensus.ErrWitnessMismatch
}
return nil
diff --git a/core/evm.go b/core/evm.go
index 3a0c0e7f8..822859572 100644
--- a/core/evm.go
+++ b/core/evm.go
@@ -55,6 +55,11 @@ func NewEVMContext(msg Message, header *types.Header, chain ChainContext, author
beneficiary = *author
}
+ ts := header.Time
+ if !*legacyEvm {
+ ts /= 1000
+ }
+
return vm.Context{
CanTransfer: CanTransfer,
Transfer: Transfer,
@@ -64,7 +69,7 @@ func NewEVMContext(msg Message, header *types.Header, chain ChainContext, author
Origin: msg.From(),
Coinbase: beneficiary,
BlockNumber: new(big.Int).Set(header.Number),
- Time: new(big.Int).SetUint64(header.Time / 1000), // seconds.
+ Time: new(big.Int).SetUint64(ts),
Randomness: header.Randomness,
Difficulty: new(big.Int).Set(header.Difficulty),
Round: new(big.Int).SetUint64(header.Round),