aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorNeozaru <neozaru@mailoo.org>2014-05-25 21:36:12 +0200
committerNeozaru <neozaru@mailoo.org>2014-05-25 21:36:12 +0200
commitaf5a28efe5b914e6154048384d82c4b0dbfdb0dc (patch)
tree5304e5cd34cc21477837a7b453ac37b489bec679 /src/cryptonote_core
parent'getaddress' wallet-rpc command (diff)
downloadmonero-af5a28efe5b914e6154048384d82c4b0dbfdb0dc.tar.xz
'mining_status' Daemon RPC command
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/miner.cpp19
-rw-r--r--src/cryptonote_core/miner.h6
2 files changed, 19 insertions, 6 deletions
diff --git a/src/cryptonote_core/miner.cpp b/src/cryptonote_core/miner.cpp
index 56b459d6e..2055bb15d 100644
--- a/src/cryptonote_core/miner.cpp
+++ b/src/cryptonote_core/miner.cpp
@@ -188,10 +188,19 @@ namespace cryptonote
return true;
}
//-----------------------------------------------------------------------------------------------------
- bool miner::is_mining()
+ bool miner::is_mining() const
{
return !m_stop;
}
+ //-----------------------------------------------------------------------------------------------------
+ const account_public_address& miner::get_mining_address() const
+ {
+ return m_mine_address;
+ }
+ //-----------------------------------------------------------------------------------------------------
+ uint32_t miner::get_threads_count() const {
+ return m_threads_total;
+ }
//-----------------------------------------------------------------------------------------------------
bool miner::start(const account_public_address& adr, size_t threads_count, const boost::thread::attributes& attrs)
{
@@ -226,12 +235,14 @@ namespace cryptonote
return true;
}
//-----------------------------------------------------------------------------------------------------
- uint64_t miner::get_speed()
+ uint64_t miner::get_speed() const
{
- if(is_mining())
+ if(is_mining()) {
return m_current_hash_rate;
- else
+ }
+ else {
return 0;
+ }
}
//-----------------------------------------------------------------------------------------------------
void miner::send_stop_signal()
diff --git a/src/cryptonote_core/miner.h b/src/cryptonote_core/miner.h
index da4578b06..f1e4e5dce 100644
--- a/src/cryptonote_core/miner.h
+++ b/src/cryptonote_core/miner.h
@@ -36,10 +36,12 @@ namespace cryptonote
bool set_block_template(const block& bl, const difficulty_type& diffic, uint64_t height);
bool on_block_chain_update();
bool start(const account_public_address& adr, size_t threads_count, const boost::thread::attributes& attrs);
- uint64_t get_speed();
+ uint64_t get_speed() const;
+ uint32_t get_threads_count() const;
void send_stop_signal();
bool stop();
- bool is_mining();
+ bool is_mining() const;
+ const account_public_address& get_mining_address() const;
bool on_idle();
void on_synchronized();
//synchronous analog (for fast calls)