Refactoring
- Skip calling time(nullptr) twice - Use getter method for m_api instead of exposing it - Moved api_udate_*() back to private since they're not used anywhere else
This commit is contained in:
+6
-5
@@ -49,7 +49,7 @@ public:
|
||||
SideChain& side_chain() { return *m_sideChain; }
|
||||
const MinerData& miner_data() const { return m_minerData; }
|
||||
|
||||
p2pool_api* m_api;
|
||||
p2pool_api* api() const { return m_api; }
|
||||
|
||||
RandomX_Hasher* hasher() const { return m_hasher; }
|
||||
bool calculate_hash(const void* data, size_t size, const hash& seed, hash& result);
|
||||
@@ -76,10 +76,6 @@ public:
|
||||
|
||||
void api_update_block_found(const ChainMain* data);
|
||||
|
||||
void api_update_network_stats();
|
||||
void api_update_pool_stats();
|
||||
void api_update_stats_mod();
|
||||
|
||||
bool get_difficulty_at_height(uint64_t height, difficulty_type& diff);
|
||||
|
||||
private:
|
||||
@@ -96,6 +92,7 @@ private:
|
||||
|
||||
Params* m_params;
|
||||
|
||||
p2pool_api* m_api;
|
||||
SideChain* m_sideChain;
|
||||
RandomX_Hasher* m_hasher;
|
||||
BlockTemplate* m_blockTemplate;
|
||||
@@ -126,6 +123,10 @@ private:
|
||||
bool parse_block_header(const char* data, size_t size, ChainMain& result);
|
||||
uint32_t parse_block_headers_range(const char* data, size_t size);
|
||||
|
||||
void api_update_network_stats();
|
||||
void api_update_pool_stats();
|
||||
void api_update_stats_mod();
|
||||
|
||||
struct FoundBlock
|
||||
{
|
||||
FORCEINLINE FoundBlock(time_t _t, uint64_t _h, const hash& _id, const difficulty_type& _block_diff, const difficulty_type& _total_hashes)
|
||||
|
||||
Reference in New Issue
Block a user