Skip to content

Commit

Permalink
IS-1199: Enabled freshness
Browse files Browse the repository at this point in the history
Signed-off-by: artem.ivanov <[email protected]>
  • Loading branch information
Artemkaaas committed Mar 25, 2019
1 parent d5648b9 commit f0519a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions libindy/src/services/pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use errors::*;
use services::pool::pool::{Pool, ZMQPool};
use utils::environment;
use utils::sequence;
use std::u64;

mod catchup;
mod commander;
Expand Down Expand Up @@ -266,7 +265,7 @@ impl PoolService {
}

lazy_static! {
static ref THRESHOLD: Mutex<u64> = Mutex::new(u64::MAX);
static ref THRESHOLD: Mutex<u64> = Mutex::new(600);
}

pub fn set_freshness_threshold(threshold: u64) {
Expand Down
2 changes: 1 addition & 1 deletion libindy/src/services/pool/request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ impl<T: Networker> RequestSM<T> {
trace!("Last signed time: {}", last_write_time);
if cnt > f
|| _check_state_proof(&result, f, &generator, &nodes, &raw_msg)
&& (_get_freshness_threshold() == u64::MAX || _get_cur_time() as u64 <= _get_freshness_threshold() + last_write_time) {
&& _get_cur_time() as u64 <= _get_freshness_threshold() + last_write_time {
state.networker.borrow_mut().process_event(Some(NetworkerEvent::CleanTimeout(req_id, None)));
_send_ok_replies(&cmd_ids, if cnt > f { &soonest } else { &raw_msg });
(RequestState::finish(), None)
Expand Down

0 comments on commit f0519a5

Please sign in to comment.