make MasternodeVotingSMC tx never timeout (#598)

This commit is contained in:
Daniel Liu 2024-08-03 07:20:24 +08:00 committed by GitHub
parent 438341c2ea
commit 824c531324
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1399,7 +1399,12 @@ func (s *PublicBlockChainAPI) Call(ctx context.Context, args CallArgs, blockNrOr
latest := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber)
blockNrOrHash = &latest
}
result, _, failed, err, vmErr := DoCall(ctx, s.b, args, *blockNrOrHash, overrides, vm.Config{}, 5*time.Second, s.b.RPCGasCap())
timeout := 5 * time.Second
MasternodeVotingSMCBinary := common.Address{19: 0x88} // xdc0000000000000000000000000000000000000088
if args.To != nil && *args.To == MasternodeVotingSMCBinary {
timeout = 0
}
result, _, failed, err, vmErr := DoCall(ctx, s.b, args, *blockNrOrHash, overrides, vm.Config{}, timeout, s.b.RPCGasCap())
if err != nil {
return nil, err
}