beta 2.5.1 (#10643)
* version: bump beta to 2.5.1 * fix(whisper expiry): current time + work + ttl (#10587) * update bootnodes (#10595) * config: update goerli bootnodes * config: update kotti bootnodes * adds rpc error message for --no-ancient-blocks (#10608) * adds error message for --no-ancient-blocks, closes #10261 * Apply suggestions from code review Co-Authored-By: seunlanlege <seunlanlege@gmail.com> * Constantinople HF on POA Core (#10606) * Constantinople HF on POA Core Plan Constantinople/St.Petersfork HF on POA Core network at block 8582254. Original PR in POA repository: https://github.com/poanetwork/poa-chain-spec/pull/110 * Remove extra empty line * evm: add some mulmod benches (#10600) * evm: add blockhash_mulmod bench * evm: use num-bigint for mod ops * Clique: zero-fill extradata when the supplied value is less than 32 bytes in length (#10605) * Update kovan.json to switch validator set to POA Consensus Contracts (#10628) * Fix publish docs (#10635) * Fix publish docs * this never should be forced, either way compiling previous versions will produce outdated docs * fix array, var was moved to the group project global variables list * Fix rinkeby petersburg fork (#10632)
This commit is contained in:
@@ -264,17 +264,17 @@ impl Message {
|
||||
|
||||
let mut rng = {
|
||||
let mut thread_rng = ::rand::thread_rng();
|
||||
|
||||
XorShiftRng::from_seed(thread_rng.gen::<[u32; 4]>())
|
||||
};
|
||||
|
||||
assert!(params.ttl > 0);
|
||||
|
||||
let expiry = {
|
||||
let after_mining = SystemTime::now().checked_sub(Duration::from_millis(params.work))
|
||||
.ok_or(Error::TimestampOverflow)?;
|
||||
let since_epoch = after_mining.duration_since(time::UNIX_EPOCH)
|
||||
.expect("time after now is after unix epoch; qed");
|
||||
let since_epoch = SystemTime::now()
|
||||
.checked_add(Duration::from_secs(params.ttl))
|
||||
.and_then(|t| t.checked_add(Duration::from_millis(params.work)))
|
||||
.ok_or(Error::TimestampOverflow)?
|
||||
.duration_since(time::UNIX_EPOCH).expect("time after now is after unix epoch; qed");
|
||||
|
||||
// round up the sub-second to next whole second.
|
||||
since_epoch.as_secs() + if since_epoch.subsec_nanos() == 0 { 0 } else { 1 }
|
||||
|
||||
Reference in New Issue
Block a user