Skip to content

Commit

Permalink
ChainService should not punish remote peer if failed to send block to…
Browse files Browse the repository at this point in the history
… orphan pool due to channel close
  • Loading branch information
eval-exec committed Jan 17, 2024
1 parent 39bd509 commit 61450f8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions chain/src/chain_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,12 @@ impl ChainService {
match self.lonely_block_tx.send(lonely_block) {
Ok(_) => {}
Err(SendError(lonely_block)) => {
error!("failed to notify new block to orphan pool");
error!("Failed to notify new block to orphan pool, It seems that the orphan pool has exited.");

let err: Error = InternalErrorKind::System
.other("OrphanBlock broker disconnected")
.into();

tell_synchronizer_to_punish_the_bad_peer(
self.verify_failed_blocks_tx.clone(),
lonely_block.peer_id_with_msg_bytes(),
lonely_block.block().hash(),
&err,
);

let verify_result = Err(err);
lonely_block.execute_callback(verify_result);
return;
Expand Down

0 comments on commit 61450f8

Please sign in to comment.