mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Send only first block candidate optimistically (#1260)
* Broadcast only the first block candidate * Fix sending block broadcast --------- Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
8364a2425f
commit
1da94e62ad
22 changed files with 164 additions and 82 deletions
|
@ -261,21 +261,22 @@ void FullNodeImpl::send_block_candidate(BlockIdExt block_id, CatchainSeqno cc_se
|
|||
}
|
||||
}
|
||||
|
||||
void FullNodeImpl::send_broadcast(BlockBroadcast broadcast, bool custom_overlays_only) {
|
||||
send_block_broadcast_to_custom_overlays(broadcast);
|
||||
if (custom_overlays_only) {
|
||||
return;
|
||||
void FullNodeImpl::send_broadcast(BlockBroadcast broadcast, int mode) {
|
||||
if (mode & broadcast_mode_custom) {
|
||||
send_block_broadcast_to_custom_overlays(broadcast);
|
||||
}
|
||||
auto shard = get_shard(ShardIdFull{masterchainId});
|
||||
if (shard.empty()) {
|
||||
VLOG(FULL_NODE_WARNING) << "dropping OUT broadcast to unknown shard";
|
||||
return;
|
||||
}
|
||||
if (broadcast.block_id.is_masterchain() && !private_block_overlays_.empty()) {
|
||||
if (!private_block_overlays_.empty() && (mode & broadcast_mode_private_block)) {
|
||||
td::actor::send_closure(private_block_overlays_.begin()->second, &FullNodePrivateBlockOverlay::send_broadcast,
|
||||
broadcast.clone());
|
||||
}
|
||||
td::actor::send_closure(shard, &FullNodeShard::send_broadcast, std::move(broadcast));
|
||||
if (mode & broadcast_mode_public) {
|
||||
td::actor::send_closure(shard, &FullNodeShard::send_broadcast, std::move(broadcast));
|
||||
}
|
||||
}
|
||||
|
||||
void FullNodeImpl::download_block(BlockIdExt id, td::uint32 priority, td::Timestamp timeout,
|
||||
|
@ -496,8 +497,8 @@ void FullNodeImpl::start_up() {
|
|||
td::actor::send_closure(id_, &FullNodeImpl::send_block_candidate, block_id, cc_seqno, validator_set_hash,
|
||||
std::move(data));
|
||||
}
|
||||
void send_broadcast(BlockBroadcast broadcast, bool custom_overlays_only) override {
|
||||
td::actor::send_closure(id_, &FullNodeImpl::send_broadcast, std::move(broadcast), custom_overlays_only);
|
||||
void send_broadcast(BlockBroadcast broadcast, int mode) override {
|
||||
td::actor::send_closure(id_, &FullNodeImpl::send_broadcast, std::move(broadcast), mode);
|
||||
}
|
||||
void download_block(BlockIdExt id, td::uint32 priority, td::Timestamp timeout,
|
||||
td::Promise<ReceivedBlock> promise) override {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue