use reversed hashes in logging
This commit is contained in:
parent
6798fff50b
commit
cbd4227f35
|
@ -372,7 +372,7 @@ impl Storage {
|
|||
/// all transaction meta is removed
|
||||
/// DOES NOT update best block
|
||||
fn decanonize_block(&self, context: &mut UpdateContext, hash: &H256) -> Result<(), Error> {
|
||||
trace!(target: "reorg", "Decanonizing block {}", hash);
|
||||
trace!(target: "reorg", "Decanonizing block {}", hash.to_reversed_str());
|
||||
|
||||
// ensure that block is of the main chain
|
||||
try!(self.block_number(hash).ok_or(Error::not_main(hash)));
|
||||
|
|
|
@ -131,11 +131,11 @@ impl<T, U, V> LocalNode<T, U, V> where T: SynchronizationTaskExecutor + PeersCon
|
|||
}
|
||||
|
||||
pub fn on_peer_transaction(&self, peer_index: usize, message: types::Tx) {
|
||||
trace!(target: "sync", "Got `transaction` message from peer#{}. Transaction hash: {}", peer_index, message.transaction.hash());
|
||||
trace!(target: "sync", "Got `transaction` message from peer#{}. Transaction hash: {}", peer_index, message.transaction.hash().to_reversed_str());
|
||||
}
|
||||
|
||||
pub fn on_peer_block(&self, peer_index: usize, message: types::Block) {
|
||||
trace!(target: "sync", "Got `block` message from peer#{}. Block hash: {}", peer_index, message.block.hash());
|
||||
trace!(target: "sync", "Got `block` message from peer#{}. Block hash: {}", peer_index, message.block.hash().to_reversed_str());
|
||||
|
||||
// try to process new block
|
||||
self.client.lock().on_peer_block(peer_index, message.block);
|
||||
|
|
|
@ -599,7 +599,13 @@ impl<T> SynchronizationClient<T> where T: TaskExecutor {
|
|||
let new_blocks_hashes = hashes.split_off(new_block_index);
|
||||
let new_blocks_headers = headers.split_off(new_block_index);
|
||||
let new_blocks_hashes_len = new_blocks_hashes.len();
|
||||
trace!(target: "sync", "Sch. {} headers from peer#{}. First {:?}, last: {:?}", new_blocks_hashes_len, peer_index, new_blocks_hashes[0], new_blocks_hashes[new_blocks_hashes_len - 1]);
|
||||
trace!(
|
||||
target: "sync", "Sch. {} headers from peer#{}. First {:?}, last: {:?}",
|
||||
new_blocks_hashes_len,
|
||||
peer_index,
|
||||
new_blocks_hashes[0].to_reversed_str(),
|
||||
new_blocks_hashes[new_blocks_hashes_len - 1].to_reversed_str()
|
||||
);
|
||||
chain.schedule_blocks_headers(new_blocks_hashes, new_blocks_headers);
|
||||
// remember peer as useful
|
||||
self.peers.useful_peer(peer_index);
|
||||
|
@ -631,7 +637,12 @@ impl<T> SynchronizationClient<T> where T: TaskExecutor {
|
|||
BlockState::Unknown => {
|
||||
if self.state.is_synchronizing() {
|
||||
// when synchronizing, we tend to receive all blocks in-order
|
||||
trace!(target: "sync", "Ignoring block {} from peer#{}, because its parent is unknown and we are synchronizing", block_hash, peer_index);
|
||||
trace!(
|
||||
target: "sync",
|
||||
"Ignoring block {} from peer#{}, because its parent is unknown and we are synchronizing",
|
||||
block_hash.to_reversed_str(),
|
||||
peer_index
|
||||
);
|
||||
// remove block from current queue
|
||||
chain.forget(&block_hash);
|
||||
// remove orphaned blocks
|
||||
|
|
|
@ -279,7 +279,13 @@ impl Server for SynchronizationServer {
|
|||
|
||||
fn serve_getblocks(&self, peer_index: usize, message: types::GetBlocks) {
|
||||
if let Some(best_common_block) = self.locate_known_block_hash(message.block_locator_hashes) {
|
||||
trace!(target: "sync", "Best common block with peer#{} is block#{}: {:?}", peer_index, best_common_block.number, best_common_block.hash);
|
||||
trace!(
|
||||
target: "sync",
|
||||
"Best common block with peer#{} is block#{}: {:?}",
|
||||
peer_index,
|
||||
best_common_block.number,
|
||||
best_common_block.hash.to_reversed_str(),
|
||||
);
|
||||
self.queue.lock().add_task(peer_index, ServerTask::ServeGetBlocks(best_common_block, message.hash_stop));
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -157,7 +157,7 @@ impl Queue {
|
|||
items.push_front(hash, ScheduleItem::Continued(item.block(), num));
|
||||
},
|
||||
Err(e) => {
|
||||
trace!(target: "verification", "Verification of block {} failed: {:?}", &hash, e);
|
||||
trace!(target: "verification", "Verification of block {} failed: {:?}", hash.to_reversed_str(), e);
|
||||
let mut invalid = self.invalid.write();
|
||||
let mut processing = self.processing.write();
|
||||
|
||||
|
|
Loading…
Reference in New Issue