From 33db4921e54b5ecf48f3fbf9abe948f27d152757 Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Sun, 23 Aug 2015 14:06:15 +0200 Subject: [auxpow] Guarantee backward compatibility on getauxblock Adds a wrapper around getauxblock to return boolean responses for getauxblock rather than bip22 responses. --- src/rpc/mining.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/rpc/mining.cpp') diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 183082f64..17e8fd57a 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -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[] = -- cgit v1.2.3