@@ -74,7 +74,7 @@ void ValidatorManagerMasterchainReiniter::got_masterchain_handle(BlockHandle han
7474 download_proof_link ();
7575}
7676
77- void ValidatorManagerMasterchainReiniter::download_proof_link () {
77+ void ValidatorManagerMasterchainReiniter::download_proof_link (bool try_local ) {
7878 if (handle_->id ().id .seqno == 0 ) {
7979 auto P = td::PromiseCreator::lambda ([SelfId = actor_id (this )](td::Result<td::Ref<ShardState>> R) {
8080 R.ensure ();
@@ -84,18 +84,29 @@ void ValidatorManagerMasterchainReiniter::download_proof_link() {
8484 td::Timestamp::in (3600 ), std::move (P))
8585 .release ();
8686 } else {
87- auto P = td::PromiseCreator::lambda ([SelfId = actor_id (this )](td::Result<td::BufferSlice> R) {
87+ auto P = td::PromiseCreator::lambda ([=, SelfId = actor_id (this )](td::Result<td::BufferSlice> R) {
8888 if (R.is_error ()) {
89- LOG (WARNING) << " failed to download proof link: " << R.move_as_error ();
89+ if (try_local) {
90+ LOG (DEBUG) << " failed to get proof link from local import: " << R.move_as_error ();
91+ } else {
92+ LOG (WARNING) << " failed to download proof link: " << R.move_as_error ();
93+ }
9094 delay_action (
91- [SelfId]() { td::actor::send_closure (SelfId, &ValidatorManagerMasterchainReiniter::download_proof_link); },
95+ [SelfId]() {
96+ td::actor::send_closure (SelfId, &ValidatorManagerMasterchainReiniter::download_proof_link, false );
97+ },
9298 td::Timestamp::in (1.0 ));
9399 } else {
94100 td::actor::send_closure (SelfId, &ValidatorManagerMasterchainReiniter::downloaded_proof_link, R.move_as_ok ());
95101 }
96102 });
97- td::actor::send_closure (manager_, &ValidatorManager::get_block_proof_link_from_import, handle_->id (), handle_->id (),
98- std::move (P));
103+ if (try_local) {
104+ td::actor::send_closure (manager_, &ValidatorManager::get_block_proof_link_from_import, handle_->id (),
105+ handle_->id (), std::move (P));
106+ } else {
107+ td::actor::send_closure (manager_, &ValidatorManager::send_get_block_proof_link_request, handle_->id (), 2 ,
108+ std::move (P));
109+ }
99110 }
100111}
101112
@@ -111,7 +122,7 @@ void ValidatorManagerMasterchainReiniter::downloaded_proof_link(td::BufferSlice
111122 auto P = td::PromiseCreator::lambda ([SelfId = actor_id (this ), db = db_, proof](td::Result<BlockHandle> R) {
112123 if (R.is_error ()) {
113124 LOG (WARNING) << " downloaded proof link failed: " << R.move_as_error ();
114- td::actor::send_closure (SelfId, &ValidatorManagerMasterchainReiniter::download_proof_link);
125+ td::actor::send_closure (SelfId, &ValidatorManagerMasterchainReiniter::download_proof_link, false );
115126 } else {
116127 auto P = td::PromiseCreator::lambda ([SelfId, handle = R.move_as_ok ()](td::Result<td::Unit> R) {
117128 R.ensure ();
0 commit comments