diff options
| author | Patrick Lodder <[email protected]> | 2015-08-23 14:06:15 +0200 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2018-09-19 21:09:16 +0100 |
| commit | 33db4921e54b5ecf48f3fbf9abe948f27d152757 (patch) | |
| tree | 682c27db284c934a161869934e711c7e7a95cbbd /src/rpc/mining.cpp | |
| parent | Change result from getauxblock to BIP22 validation state (diff) | |
| download | discoin-33db4921e54b5ecf48f3fbf9abe948f27d152757.tar.xz discoin-33db4921e54b5ecf48f3fbf9abe948f27d152757.zip | |
[auxpow] Guarantee backward compatibility on getauxblock
Adds a wrapper around getauxblock to return boolean responses
for getauxblock rather than bip22 responses.
Diffstat (limited to 'src/rpc/mining.cpp')
| -rw-r--r-- | src/rpc/mining.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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[] = |