From fa178a6385bf300499fb18940051fc4142fb5b6b Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 11 Feb 2019 11:59:34 -0500 Subject: [rpc] mining: Omit uninitialized currentblockweight, currentblocktx --- doc/release-notes.md | 3 +++ src/miner.cpp | 21 ++++++++------------- src/miner.h | 9 +++++++-- src/rpc/mining.cpp | 28 ++++++++++++++-------------- src/validation.h | 6 ++---- test/functional/mining_basic.py | 28 +++++++++++++++++++++++----- test/functional/test_framework/blocktools.py | 6 +++++- 7 files changed, 62 insertions(+), 39 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index 113b8c07d0..a6408cf1e6 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -263,6 +263,9 @@ in the Low-level Changes section below. - See the [Mining](#mining) section for changes to `getblocktemplate`. +- The `getmininginfo` RPC now omits `currentblockweight` and `currentblocktx` + when a block was never assembled via RPC on this node. + - The `getrawtransaction` RPC & REST endpoints no longer check the unspent UTXO set for a transaction. The remaining behaviors are as follows: 1. If a blockhash is provided, check the corresponding block. diff --git a/src/miner.cpp b/src/miner.cpp index ef48a86e32..80a2f8f018 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2018 The Bitcoin Core developers +// Copyright (c) 2009-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -10,8 +10,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -21,22 +21,14 @@ #include #include