Skip to content

Commit

Permalink
Add log
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxbin committed Oct 20, 2020
1 parent f23c681 commit 534ba9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions core/network/src/sync.rs
Expand Up @@ -144,13 +144,6 @@ impl<B: BlockT> PendingJustifications<B> {
self.pending_requests.push_back(request);
}

println!("debug dispatch");
println!("peer_requests: {:?}", self.peer_requests);
println!("pending_requests: {:?}", self.pending_requests);
println!("peers: {:?}", peers);
println!("justifications: {:?}", self.justifications.roots().collect::<Vec<_>>());
println!("debug dispatch end");

if self.pending_requests.is_empty() {
return;
}
Expand Down Expand Up @@ -261,6 +254,8 @@ impl<B: BlockT> PendingJustifications<B> {
is_descendent_of: F,
force: bool,
) where F: Fn(&B::Hash, &B::Hash) -> Result<bool, ClientError> {
trace!("queue_request: hash: {} number:{} justifications_finalized: {:?}", justification.0.clone(), justification.1.clone(), self.justifications.best_finalized_number);

match self.justifications.import(justification.0.clone(), justification.1.clone(), (), &is_descendent_of) {
Ok(true) => {
// this is a new root so we add it to the current `pending_requests`
Expand Down
2 changes: 1 addition & 1 deletion core/util/fork-tree/src/lib.rs
Expand Up @@ -82,7 +82,7 @@ pub enum FinalizationResult<V> {
#[derive(Clone, Debug, Decode, Encode, PartialEq)]
pub struct ForkTree<H, N, V> {
roots: Vec<Node<H, N, V>>,
best_finalized_number: Option<N>,
pub best_finalized_number: Option<N>,
}

impl<H, N, V> ForkTree<H, N, V> where
Expand Down

0 comments on commit 534ba9b

Please sign in to comment.