Revert behaviour change in getauxblock

Change getauxblock to respond with a "target" field instead of "_target".
This commit is contained in:
Ross Nicoll 2019-07-13 19:11:28 +00:00
parent b84d1fe1d9
commit dbfb33abe0
3 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 14)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)

View file

@ -25,7 +25,7 @@ class GetAuxBlockTest (BitcoinTestFramework):
assert_equal (auxblock['previousblockhash'], blocktemplate['previousblockhash'])
# Compare target and take byte order into account.
target = auxblock['_target']
target = auxblock['target']
reversedTarget = auxpow.reverseHex (target)
assert_equal (reversedTarget, blocktemplate['target'])

View file

@ -474,10 +474,10 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0)
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Bitcoin is not connected!");
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Dogecoin is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Bitcoin is downloading blocks...");
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Dogecoin is downloading blocks...");
static unsigned int nTransactionsUpdatedLast;
@ -958,7 +958,7 @@ UniValue getauxblockbip22(const JSONRPCRequest& request)
" \"coinbasevalue\" (numeric) value of the block's coinbase\n"
" \"bits\" (string) compressed target of the block\n"
" \"height\" (numeric) height of the block\n"
" \"_target\" (string) target in reversed byte order, deprecated\n"
" \"target\" (string) target in reversed byte order\n"
"}\n"
"\nResult (with arguments):\n"
"xxxxx (boolean) whether the submitted block was correct\n"
@ -1065,7 +1065,7 @@ UniValue getauxblockbip22(const JSONRPCRequest& request)
result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0]->vout[0].nValue));
result.push_back(Pair("bits", strprintf("%08x", pblock->nBits)));
result.push_back(Pair("height", static_cast<int64_t> (pindexPrev->nHeight + 1)));
result.push_back(Pair("_target", HexStr(BEGIN(target), END(target))));
result.push_back(Pair("target", HexStr(BEGIN(target), END(target))));
return result;
}