Merge pull request #1827

db1c7d80 wallet api: add missing mining options (Jaquee)
This commit is contained in:
Riccardo Spagni 2017-03-03 14:31:28 +02:00
commit e24cd86c18
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
3 changed files with 5 additions and 3 deletions

View file

@ -417,13 +417,15 @@ bool WalletManagerImpl::isMining() const
return mres.active; return mres.active;
} }
bool WalletManagerImpl::startMining(const std::string &address, uint32_t threads) bool WalletManagerImpl::startMining(const std::string &address, uint32_t threads, bool background_mining, bool ignore_battery)
{ {
cryptonote::COMMAND_RPC_START_MINING::request mreq; cryptonote::COMMAND_RPC_START_MINING::request mreq;
cryptonote::COMMAND_RPC_START_MINING::response mres; cryptonote::COMMAND_RPC_START_MINING::response mres;
mreq.miner_address = address; mreq.miner_address = address;
mreq.threads_count = threads; mreq.threads_count = threads;
mreq.ignore_battery = ignore_battery;
mreq.do_background_mining = background_mining;
if (!connect_and_invoke(m_daemonAddress, "/start_mining", mreq, mres)) if (!connect_and_invoke(m_daemonAddress, "/start_mining", mreq, mres))
return false; return false;

View file

@ -62,7 +62,7 @@ public:
void hardForkInfo(uint8_t &version, uint64_t &earliest_height) const; void hardForkInfo(uint8_t &version, uint64_t &earliest_height) const;
uint64_t blockTarget() const; uint64_t blockTarget() const;
bool isMining() const; bool isMining() const;
bool startMining(const std::string &address, uint32_t threads = 1); bool startMining(const std::string &address, uint32_t threads = 1, bool background_mining = false, bool ignore_battery = true);
bool stopMining(); bool stopMining();
std::string resolveOpenAlias(const std::string &address, bool &dnssec_valid) const; std::string resolveOpenAlias(const std::string &address, bool &dnssec_valid) const;

View file

@ -696,7 +696,7 @@ struct WalletManager
virtual bool isMining() const = 0; virtual bool isMining() const = 0;
//! starts mining with the set number of threads //! starts mining with the set number of threads
virtual bool startMining(const std::string &address, uint32_t threads = 1) = 0; virtual bool startMining(const std::string &address, uint32_t threads = 1, bool background_mining = false, bool ignore_battery = true) = 0;
//! stops mining //! stops mining
virtual bool stopMining() = 0; virtual bool stopMining() = 0;