mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
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.
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user