Skip to content

Commit

Permalink
logs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bayk committed Dec 4, 2024
1 parent f6a0afa commit 86203e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions chain/src/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ fn update_header_head(head: &Tip, batch: &store::Batch<'_>) -> Result<(), Error>
.map_err(|e| Error::StoreErr(e, "pipe save header head".to_owned()))?;

debug!(
"header head updated to {} at {}",
"header head updated to {} at {}",
head.last_block_h, head.height
);

Expand All @@ -832,7 +832,7 @@ fn update_head(head: &Tip, batch: &store::Batch<'_>) -> Result<(), Error> {
.save_body_head(&head)
.map_err(|e| Error::StoreErr(e, "pipe save body".to_owned()))?;

debug!("head updated to {} at {}", head.last_block_h, head.height);
debug!("head updated to {} at {}", head.last_block_h, head.height);

Ok(())
}
Expand Down
16 changes: 10 additions & 6 deletions servers/src/mwc/sync/header_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ impl HeaderSync {
let peer = peers
.choose(&mut rng)
.expect("Internal error. peers are empty");
match self.request_headers_for_hash(hash.clone(), peer.clone()) {
match self.request_headers_for_hash(hash.clone(), height, peer.clone())
{
Ok(_) => {
self.request_tracker.register_request(
hash,
Expand Down Expand Up @@ -372,9 +373,11 @@ impl HeaderSync {
let peer = peers
.choose(&mut rng)
.expect("Internal error. peers are empty");
match self
.request_headers_for_hash(hash.clone(), peer.clone())
{
match self.request_headers_for_hash(
hash.clone(),
height,
peer.clone(),
) {
Ok(_) => {
self.request_tracker.register_request(
hash,
Expand Down Expand Up @@ -526,11 +529,12 @@ impl HeaderSync {
fn request_headers_for_hash(
&self,
header_hash: Hash,
height: u64,
peer: Arc<Peer>,
) -> Result<(), chain::Error> {
debug!(
"sync: request_headers: asking {} for headers at hash {}",
peer.info.addr, header_hash
"sync: request_headers: asking {} for headers at hash {}, height {}",
peer.info.addr, header_hash, height
);
peer.send_header_request(vec![header_hash])
.map_err(|e| chain::Error::Other(format!("{}", e)))?;
Expand Down

0 comments on commit 86203e0

Please sign in to comment.