Add CashAddr Address Format
Ported from Bitcoin Unlimited, Bitcoin ABC
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "consensus/consensus.h"
|
||||
#include "consensus/validation.h"
|
||||
#include "core_io.h"
|
||||
#include "dstencode.h"
|
||||
#include "init.h"
|
||||
#include "main.h"
|
||||
#include "miner.h"
|
||||
@@ -226,6 +227,16 @@ UniValue setgenerate(const UniValue& params, bool fHelp)
|
||||
|
||||
mapArgs["-gen"] = (fGenerate ? "1" : "0");
|
||||
mapArgs ["-genproclimit"] = itostr(nGenProcLimit);
|
||||
|
||||
CTxDestination destination = DecodeDestination(params[1].get_str());
|
||||
if (!IsValidDestination(destination)) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY,
|
||||
"Error: Invalid address");
|
||||
}
|
||||
|
||||
boost::shared_ptr<CReserveScript> coinbaseScript(new CReserveScript());
|
||||
coinbaseScript->reserveScript = GetScriptForDestination(destination);
|
||||
|
||||
GenerateBitcoins(fGenerate, nGenProcLimit, Params());
|
||||
|
||||
return NullUniValue;
|
||||
|
||||
Reference in New Issue
Block a user