[auxpow] Guarantee backward compatibility on getauxblock

Adds a wrapper around getauxblock to return boolean responses
for getauxblock rather than bip22 responses.
This commit is contained in:
Patrick Lodder 2015-08-23 14:06:15 +02:00 committed by Ross Nicoll
parent 4b33236028
commit 33db4921e5

View file

@ -936,7 +936,7 @@ UniValue estimatesmartpriority(const JSONRPCRequest& request)
/* ************************************************************************** */
/* Merge mining. */
UniValue getauxblock(const JSONRPCRequest& request)
UniValue getauxblockbip22(const JSONRPCRequest& request)
{
if (request.fHelp
|| (request.params.size() != 0 && request.params.size() != 2))
@ -1102,6 +1102,18 @@ UniValue getauxblock(const JSONRPCRequest& request)
return BIP22ValidationResult(sc.state);
}
UniValue getauxblock(const JSONRPCRequest& request)
{
const UniValue response = getauxblockbip22(request);
// this is a request for a new blocktemplate: return response
if (request.params.size() == 0)
return response;
// this is a new block submission: return bool
return response.isNull();
}
/* ************************************************************************** */
static const CRPCCommand commands[] =