Skip to content

Commit

Permalink
Fix rebase conflicts with develop: https://github.com/nervosnetwork/c…
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Feb 2, 2024
1 parent 11abfc6 commit aa71451
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
5 changes: 2 additions & 3 deletions sync/src/relayer/block_transactions_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@ impl<'a> BlockTransactionsProcess<'a> {
match ret {
ReconstructionResult::Block(block) => {
pending.remove();
let status = self
.relayer
self.relayer
.accept_block(self.nc.as_ref(), self.peer, block);
return status;
return Status::ok();
}
ReconstructionResult::Missing(transactions, uncles) => {
// We need to get all transactions and uncles that do not exist locally
Expand Down
5 changes: 2 additions & 3 deletions sync/src/relayer/compact_block_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,15 @@ impl<'a> CompactBlockProcess<'a> {
>= block.epoch().number()
});
shrink_to_fit!(pending_compact_blocks, 20);
let status = self
.relayer
self.relayer
.accept_block(self.nc.as_ref(), self.peer, block);

if let Some(metrics) = ckb_metrics::handle() {
metrics
.ckb_relay_cb_verify_duration
.observe(instant.elapsed().as_secs_f64());
}
status
Status::ok()
}
ReconstructionResult::Missing(transactions, uncles) => {
let missing_transactions: Vec<u32> =
Expand Down
8 changes: 3 additions & 5 deletions sync/src/relayer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ use self::get_transactions_process::GetTransactionsProcess;
use self::transaction_hashes_process::TransactionHashesProcess;
use self::transactions_process::TransactionsProcess;
use crate::types::{ActiveChain, SyncShared};
use crate::utils::{
is_internal_db_error, metric_ckb_message_bytes, send_message_to, MetricDirection,
};
use crate::utils::{metric_ckb_message_bytes, send_message_to, MetricDirection};
use crate::{Status, StatusCode};
use ckb_chain::VerifyResult;
use ckb_chain::{ChainController, RemoteBlock};
Expand Down Expand Up @@ -303,13 +301,13 @@ impl Relayer {
_nc: &dyn CKBProtocolContext,
peer_id: PeerIndex,
block: core::BlockView,
) -> Status {
) {
if self
.shared()
.active_chain()
.contains_block_status(&block.hash(), BlockStatus::BLOCK_STORED)
{
return Status::ok();
return;
}

let block = Arc::new(block);
Expand Down

0 comments on commit aa71451

Please sign in to comment.