MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / proxy_enable_disable

Method proxy_enable_disable

runners/proxy/ProxyRunner.cpp:1359–1384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1357}
1358
1359void ProxyRunner::proxy_enable_disable(td::int64 value) {
1360 if (!is_initialized()) {
1361 return;
1362 }
1363 if (is_disabled_until_version_ > 0) {
1364 if (is_disabled_until_version_ < value) {
1365 is_disabled_until_version_ = value;
1366 } else {
1367 is_disabled_until_version_ =
1368 std::max<td::int64>(value, runner_config()->root_contract_config->params_version() + 1);
1369 }
1370 } else {
1371 if (value <= runner_config()->root_contract_config->params_version()) {
1372 return;
1373 } else {
1374 is_disabled_until_version_ = value;
1375 kv_->begin_transaction().ensure();
1376
1377 close_all();
1378 config_to_db(runner_config());
1379
1380 kv_->commit_transaction().ensure();
1381 CHECK(is_disabled());
1382 }
1383 }
1384}
1385
1386void ProxyRunner::run_withdraw() {
1387 if (running_withdraw_) {

Callers

nothing calls this directly

Calls 1

params_versionMethod · 0.80

Tested by

no test coverage detected