diff options
| author | Ben Woosley <[email protected]> | 2018-05-20 14:04:15 -0700 |
|---|---|---|
| committer | Ben Woosley <[email protected]> | 2018-05-20 22:19:42 -0700 |
| commit | ebec7317ca1acbc65afa7fb08fc219c315fc4527 (patch) | |
| tree | 7cce4ca196629a3bf18637f2adfee7fc7bfc717b /src/rpc/mining.cpp | |
| parent | Merge #13228: Add script to detect circular dependencies between source modules (diff) | |
| download | discoin-ebec7317ca1acbc65afa7fb08fc219c315fc4527.tar.xz discoin-ebec7317ca1acbc65afa7fb08fc219c315fc4527.zip | |
Drop the chain argument to GetDifficulty
This removes the need to include rpc/blockchain.cpp in order to put
GetDifficulty under test. GetDifficulty was called in two ways:
* with a guaranteed non-null blockindex
* with no argument
Change the latter case to be provided chainActive.Tip() explicitly.
Diffstat (limited to 'src/rpc/mining.cpp')
| -rw-r--r-- | src/rpc/mining.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 203fac39e..85b864e6b 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -214,7 +214,7 @@ static UniValue getmininginfo(const JSONRPCRequest& request) obj.pushKV("blocks", (int)chainActive.Height()); obj.pushKV("currentblockweight", (uint64_t)nLastBlockWeight); obj.pushKV("currentblocktx", (uint64_t)nLastBlockTx); - obj.pushKV("difficulty", (double)GetDifficulty()); + obj.pushKV("difficulty", (double)GetDifficulty(chainActive.Tip())); obj.pushKV("networkhashps", getnetworkhashps(request)); obj.pushKV("pooledtx", (uint64_t)mempool.size()); obj.pushKV("chain", Params().NetworkIDString()); |