mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Tonlib: change liteservers on query timeout or connection close
This commit is contained in:
parent
69cee95abb
commit
33a079962f
16 changed files with 117 additions and 37 deletions
|
@ -25,13 +25,16 @@ namespace ton {
|
|||
namespace adnl {
|
||||
|
||||
void AdnlQuery::alarm() {
|
||||
promise_.set_error(td::Status::Error(ErrorCode::timeout, "adnl query timeout"));
|
||||
stop();
|
||||
set_error(td::Status::Error(ErrorCode::timeout, "adnl query timeout"));
|
||||
}
|
||||
void AdnlQuery::result(td::BufferSlice data) {
|
||||
promise_.set_value(std::move(data));
|
||||
stop();
|
||||
}
|
||||
void AdnlQuery::set_error(td::Status error) {
|
||||
promise_.set_error(std::move(error));
|
||||
stop();
|
||||
}
|
||||
|
||||
AdnlQueryId AdnlQuery::random_query_id() {
|
||||
AdnlQueryId q_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue