diff options
| author | Patrick Lodder <[email protected]> | 2015-08-23 14:06:15 +0200 |
|---|---|---|
| committer | Patrick Lodder <[email protected]> | 2015-08-23 16:13:41 +0200 |
| commit | e2334c99e6d5092c30c0a441fb666973bba22fb8 (patch) | |
| tree | f281ea7a1ae0dae124b372bc79aea37dad52d21d /src/rpcmining.cpp | |
| parent | Merge pull request #1247 from rnicoll/1.10-attribution (diff) | |
| download | discoin-e2334c99e6d5092c30c0a441fb666973bba22fb8.tar.xz discoin-e2334c99e6d5092c30c0a441fb666973bba22fb8.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/rpcmining.cpp')
| -rw-r--r-- | src/rpcmining.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index ab878c105..87693bd8e 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -732,7 +732,7 @@ Value estimatepriority(const Array& params, bool fHelp) /* Merge mining. */ #ifdef ENABLE_WALLET -Value getauxblock(const Array& params, bool fHelp) +Value getauxblockbip22(const Array& params, bool fHelp) { if (fHelp || (params.size() != 0 && params.size() != 2)) throw std::runtime_error( @@ -904,4 +904,16 @@ Value getauxblock(const Array& params, bool fHelp) } return BIP22ValidationResult(state); } + +Value getauxblock(const Array& params, bool fHelp) +{ + Value response = getauxblockbip22(params, fHelp); + + // this is a request for a new blocktemplate: return response + if (params.size() == 0) + return response; + + // this is a new block submission: return bool + return (response == Value::null); +} #endif // ENABLE_WALLET |