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

Method http_payout

runners/proxy/ProxyRunner.cpp:1600–1617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1598 */
1599
1600std::string ProxyRunner::http_payout(std::string worker_sc_address) {
1601 auto it2 = workers_.find(worker_sc_address);
1602 if (it2 == workers_.end()) {
1603 return wrap_short_answer_to_http("worker not found");
1604 }
1605 auto &worker = *it2->second;
1606 if (worker.paying_now()) {
1607 return wrap_short_answer_to_http("request already running");
1608 }
1609 if (is_initialized()) {
1610 all_to_db();
1611 }
1612 if (!worker.tokens_ready_to_pay()) {
1613 return wrap_short_answer_to_http("nothing to pay");
1614 }
1615 worker_payout(worker, false);
1616 return wrap_short_answer_to_http("request sent");
1617}
1618
1619std::string ProxyRunner::http_charge(std::string client_owner_address_str) {
1620 auto it2 = clients_.find(client_owner_address_str);

Callers

nothing calls this directly

Calls 2

paying_nowMethod · 0.80
tokens_ready_to_payMethod · 0.80

Tested by

no test coverage detected