mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Improve block broadcasts processing; add special overlay for blocks for validators (#885)
* Improve block broadcast processing
* ValidatorManagerImpl::written_handle
* Retry sending broadcasts in ValidatorGroup
* Fix setting channel_ready in AdnlPeerPair
* Add special overlay for validators for block broadcasting (#842)
* Private overlay for broadcasting blocks
---------
Co-authored-by: SpyCheese <mikle98@yandex.ru>
(cherry picked from commit a52045bd91
)
---------
Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
a11ffb1637
commit
59927ba534
16 changed files with 410 additions and 30 deletions
|
@ -1185,7 +1185,7 @@ void ValidatorManagerImpl::write_handle(BlockHandle handle, td::Promise<td::Unit
|
|||
void ValidatorManagerImpl::written_handle(BlockHandle handle, td::Promise<td::Unit> promise) {
|
||||
bool received = handle->received();
|
||||
bool inited_state = handle->received_state();
|
||||
bool inited_proof = handle->id().is_masterchain() ? handle->inited_proof() : handle->inited_proof();
|
||||
bool inited_proof = handle->id().is_masterchain() ? handle->inited_proof() : handle->inited_proof_link();
|
||||
|
||||
if (handle->need_flush()) {
|
||||
handle->flush(actor_id(this), handle, std::move(promise));
|
||||
|
@ -1198,11 +1198,24 @@ void ValidatorManagerImpl::written_handle(BlockHandle handle, td::Promise<td::Un
|
|||
td::actor::send_closure(it->second.actor_, &WaitBlockData::force_read_from_db);
|
||||
}
|
||||
}
|
||||
if (inited_state && inited_proof) {
|
||||
if (inited_state) {
|
||||
auto it = wait_state_.find(handle->id());
|
||||
if (it != wait_state_.end()) {
|
||||
td::actor::send_closure(it->second.actor_, &WaitBlockState::force_read_from_db);
|
||||
}
|
||||
} else {
|
||||
if (handle->inited_proof_link()) {
|
||||
auto it = wait_state_.find(handle->id());
|
||||
if (it != wait_state_.end()) {
|
||||
td::actor::send_closure(it->second.actor_, &WaitBlockState::after_get_proof_link);
|
||||
}
|
||||
}
|
||||
if (handle->id().is_masterchain() && handle->inited_proof()) {
|
||||
auto it = wait_state_.find(handle->id());
|
||||
if (it != wait_state_.end()) {
|
||||
td::actor::send_closure(it->second.actor_, &WaitBlockState::after_get_proof);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
promise.set_value(td::Unit());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue