Merge pull request #1264 from patricklodder/1.10-auxrpc-no-bip22

[auxpow] Guarantee backward compatibility on getauxblock
This commit is contained in:
Max K. 2015-08-26 21:52:55 +02:00
commit 340163962e

View File

@ -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