mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Quieten txhashset logging (#846)
* suppress the log msg until we start fast sync, we need to be past the horizon before we do this
This commit is contained in:
parent
675faec05d
commit
4b639cae5c
1 changed files with 14 additions and 12 deletions
|
@ -94,21 +94,22 @@ pub fn run_sync(
|
|||
if current_time - prev_state_sync > time::Duration::seconds(5 * 60) {
|
||||
if let Some(peer) = peers.most_work_peer() {
|
||||
if let Ok(p) = peer.try_read() {
|
||||
debug!(
|
||||
LOGGER,
|
||||
"Header head before txhashset request: {} / {}",
|
||||
header_head.height,
|
||||
header_head.last_block_h
|
||||
);
|
||||
|
||||
// just to handle corner case of a too early start
|
||||
if header_head.height > horizon {
|
||||
debug!(
|
||||
LOGGER,
|
||||
"Header head before txhashset request: {} / {}",
|
||||
header_head.height,
|
||||
header_head.last_block_h
|
||||
);
|
||||
|
||||
// ask for txhashset at horizon
|
||||
let mut txhashset_head =
|
||||
chain.get_block_header(&header_head.prev_block_h).unwrap();
|
||||
for _ in 0..horizon - 2 {
|
||||
txhashset_head =
|
||||
chain.get_block_header(&txhashset_head.previous).unwrap();
|
||||
txhashset_head = chain
|
||||
.get_block_header(&txhashset_head.previous)
|
||||
.unwrap();
|
||||
}
|
||||
p.send_txhashset_request(
|
||||
txhashset_head.height,
|
||||
|
@ -259,7 +260,8 @@ fn needs_syncing(
|
|||
if is_syncing {
|
||||
if let Some(peer) = peer {
|
||||
if let Ok(peer) = peer.try_read() {
|
||||
debug!(LOGGER,
|
||||
debug!(
|
||||
LOGGER,
|
||||
"needs_syncing {} {} {}", local_diff, peer.info.total_difficulty, header_only
|
||||
);
|
||||
|
||||
|
@ -278,7 +280,7 @@ fn needs_syncing(
|
|||
}
|
||||
} else {
|
||||
info!(LOGGER, "sync: no peers available, disabling sync");
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if let Some(peer) = peer {
|
||||
|
@ -298,7 +300,7 @@ fn needs_syncing(
|
|||
peer.info.total_difficulty,
|
||||
threshold,
|
||||
);
|
||||
return true
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue