Monero
Loading...
Searching...
No Matches
cryptonote::rpc_payment Class Reference

#include <rpc_payment.h>

Collaboration diagram for cryptonote::rpc_payment:

Classes

struct  client_info

Public Member Functions

 rpc_payment (const cryptonote::account_public_address &address, uint64_t diff, uint64_t credits_per_hash_found)
uint64_t balance (const crypto::public_key &client, int64_t delta=0)
bool pay (const crypto::public_key &client, uint64_t ts, uint64_t payment, const std::string &rpc, bool same_ts, uint64_t &credits)
bool get_info (const crypto::public_key &client, const std::function< bool(const cryptonote::blobdata &, cryptonote::block &, uint64_t &seed_height, crypto::hash &seed_hash)> &get_block_template, cryptonote::blobdata &hashing_blob, uint64_t &seed_height, crypto::hash &seed_hash, const crypto::hash &top, uint64_t &diff, uint64_t &credits_per_hash_found, uint64_t &credits, uint32_t &cookie)
bool submit_nonce (const crypto::public_key &client, uint32_t nonce, const crypto::hash &top, int64_t &error_code, std::string &error_message, uint64_t &credits, crypto::hash &hash, cryptonote::block &block, uint32_t cookie, bool &stale)
const cryptonote::account_public_addressget_payment_address () const
bool foreach (const std::function< bool(const crypto::public_key &client, const client_info &info)> &f) const
unsigned int flush_by_age (time_t seconds=0)
uint64_t get_hashes (unsigned int seconds) const
void prune_hashrate (unsigned int seconds)
bool on_idle ()
template<class t_archive>
void serialize (t_archive &a, const unsigned int ver)
bool load (std::string directory)
bool store (const std::string &directory=std::string()) const

Private Attributes

cryptonote::account_public_address m_address
uint64_t m_diff
uint64_t m_credits_per_hash_found
serializable_unordered_map< crypto::public_key, client_infom_client_info
std::string m_directory
serializable_map< uint64_t, uint64_tm_hashrate
uint64_t m_credits_total
uint64_t m_credits_used
uint64_t m_nonces_good
uint64_t m_nonces_stale
uint64_t m_nonces_bad
uint64_t m_nonces_dupe
boost::mutex mutex

Constructor & Destructor Documentation

◆ rpc_payment()

cryptonote::rpc_payment::rpc_payment ( const cryptonote::account_public_address & address,
uint64_t diff,
uint64_t credits_per_hash_found )

Member Function Documentation

◆ balance()

uint64_t cryptonote::rpc_payment::balance ( const crypto::public_key & client,
int64_t delta = 0 )

◆ flush_by_age()

unsigned int cryptonote::rpc_payment::flush_by_age ( time_t seconds = 0)

◆ foreach()

bool cryptonote::rpc_payment::foreach ( const std::function< bool(const crypto::public_key &client, const client_info &info)> & f) const

◆ get_hashes()

uint64_t cryptonote::rpc_payment::get_hashes ( unsigned int seconds) const

◆ get_info()

bool cryptonote::rpc_payment::get_info ( const crypto::public_key & client,
const std::function< bool(const cryptonote::blobdata &, cryptonote::block &, uint64_t &seed_height, crypto::hash &seed_hash)> & get_block_template,
cryptonote::blobdata & hashing_blob,
uint64_t & seed_height,
crypto::hash & seed_hash,
const crypto::hash & top,
uint64_t & diff,
uint64_t & credits_per_hash_found,
uint64_t & credits,
uint32_t & cookie )

◆ get_payment_address()

const cryptonote::account_public_address & cryptonote::rpc_payment::get_payment_address ( ) const
inline

◆ load()

bool cryptonote::rpc_payment::load ( std::string directory)

◆ on_idle()

bool cryptonote::rpc_payment::on_idle ( )

◆ pay()

bool cryptonote::rpc_payment::pay ( const crypto::public_key & client,
uint64_t ts,
uint64_t payment,
const std::string & rpc,
bool same_ts,
uint64_t & credits )

◆ prune_hashrate()

void cryptonote::rpc_payment::prune_hashrate ( unsigned int seconds)

◆ serialize()

template<class t_archive>
void cryptonote::rpc_payment::serialize ( t_archive & a,
const unsigned int ver )
inline

◆ store()

bool cryptonote::rpc_payment::store ( const std::string & directory = std::string()) const

◆ submit_nonce()

bool cryptonote::rpc_payment::submit_nonce ( const crypto::public_key & client,
uint32_t nonce,
const crypto::hash & top,
int64_t & error_code,
std::string & error_message,
uint64_t & credits,
crypto::hash & hash,
cryptonote::block & block,
uint32_t cookie,
bool & stale )

Member Data Documentation

◆ m_address

cryptonote::account_public_address cryptonote::rpc_payment::m_address
private

◆ m_client_info

serializable_unordered_map<crypto::public_key, client_info> cryptonote::rpc_payment::m_client_info
private

◆ m_credits_per_hash_found

uint64_t cryptonote::rpc_payment::m_credits_per_hash_found
private

◆ m_credits_total

uint64_t cryptonote::rpc_payment::m_credits_total
private

◆ m_credits_used

uint64_t cryptonote::rpc_payment::m_credits_used
private

◆ m_diff

uint64_t cryptonote::rpc_payment::m_diff
private

◆ m_directory

std::string cryptonote::rpc_payment::m_directory
private

◆ m_hashrate

serializable_map<uint64_t, uint64_t> cryptonote::rpc_payment::m_hashrate
private

◆ m_nonces_bad

uint64_t cryptonote::rpc_payment::m_nonces_bad
private

◆ m_nonces_dupe

uint64_t cryptonote::rpc_payment::m_nonces_dupe
private

◆ m_nonces_good

uint64_t cryptonote::rpc_payment::m_nonces_good
private

◆ m_nonces_stale

uint64_t cryptonote::rpc_payment::m_nonces_stale
private

◆ mutex

boost::mutex cryptonote::rpc_payment::mutex
mutableprivate

The documentation for this class was generated from the following files: