Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix(whisper): expiry should be UNIX_TIME + TTL
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasad1 committed Apr 11, 2019
1 parent 9e2b2b3 commit e105b81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion whisper/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl Message {
assert!(params.ttl > 0);

let expiry = {
let after_mining = SystemTime::now().checked_sub(Duration::from_millis(params.work))
let after_mining = SystemTime::now().checked_add(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");
Expand Down

0 comments on commit e105b81

Please sign in to comment.