Merge pull request #386 from meshplus/fix/timestamp-check

fix(api): loose timestamp prev limit and tight post time limit
This commit is contained in:
Aiden X 2021-04-26 18:09:35 +08:00 committed by GitHub
commit aa47f61036
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -70,8 +70,8 @@ func (cbs *ChainBrokerService) checkTransaction(tx *pb.Transaction) error {
return fmt.Errorf("can't deploy empty contract")
}
if tx.Timestamp < time.Now().UnixNano()-10*time.Minute.Nanoseconds() ||
tx.Timestamp > time.Now().UnixNano()+10*time.Minute.Nanoseconds() {
if tx.Timestamp < time.Now().UnixNano()-30*time.Minute.Nanoseconds() ||
tx.Timestamp > time.Now().UnixNano()+5*time.Minute.Nanoseconds() {
return fmt.Errorf("timestamp is illegal")
}