| 1598 | */ |
| 1599 | |
| 1600 | std::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 | |
| 1619 | std::string ProxyRunner::http_charge(std::string client_owner_address_str) { |
| 1620 | auto it2 = clients_.find(client_owner_address_str); |
nothing calls this directly
no test coverage detected