rpc: remove pay-to-use RPC on node side

Co-authored-by: tobtoht <tob@featherwallet.org>
Co-authored-by: SNeedlewoods <sneedlewoods_1@protonmail.com>
This commit is contained in:
jeffro256
2026-05-26 22:54:30 +02:00
committed by tobtoht
co-authored by tobtoht SNeedlewoods
parent 5e44d79824
commit 9b337ca01f
31 changed files with 12 additions and 2300 deletions
-42
View File
@@ -37,7 +37,6 @@
#include "cryptonote_core/cryptonote_core.h"
#include "cryptonote_basic/difficulty.h"
#include "cryptonote_basic/hardfork.h"
#include "rpc/rpc_payment_signature.h"
#include "rpc/rpc_version_str.h"
#include <boost/format.hpp>
#include <ctime>
@@ -2469,47 +2468,6 @@ bool t_rpc_command_executor::flush_cache(bool bad_blocks)
return true;
}
bool t_rpc_command_executor::rpc_payments()
{
cryptonote::COMMAND_RPC_ACCESS_DATA::request req;
cryptonote::COMMAND_RPC_ACCESS_DATA::response res;
std::string fail_message = "Unsuccessful";
epee::json_rpc::error error_resp;
if (m_is_rpc)
{
if (!m_rpc_client->json_rpc_request(req, res, "rpc_access_data", fail_message.c_str()))
{
return true;
}
}
else
{
if (!m_rpc_server->on_rpc_access_data(req, res, error_resp) || res.status != CORE_RPC_STATUS_OK)
{
tools::fail_msg_writer() << make_error(fail_message, res.status);
return true;
}
}
const uint64_t now = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
uint64_t balance = 0;
tools::msg_writer() << boost::format("%64s %16u %16u %8u %8u %8u %8u %s")
% "Client ID" % "Balance" % "Total mined" % "Good" % "Stale" % "Bad" % "Dupes" % "Last update";
for (const auto &entry: res.entries)
{
tools::msg_writer() << boost::format("%64s %16u %16u %8u %8u %8u %8u %s")
% entry.client % entry.balance % entry.credits_total
% entry.nonces_good % entry.nonces_stale % entry.nonces_bad % entry.nonces_dupe
% (entry.last_update_time == 0 ? "never" : get_human_time_ago(entry.last_update_time, now).c_str());
balance += entry.balance;
}
tools::msg_writer() << res.entries.size() << " clients with a total of " << balance << " credits";
tools::msg_writer() << "Aggregated client hash rate: " << get_mining_speed(res.hashrate);
return true;
}
bool t_rpc_command_executor::version()
{
cryptonote::COMMAND_RPC_GET_INFO::request req;