Merge pull request #235 from kallewoof/getnewblockhex-coinbase

getnewblockhex would use regtest coinbase hard coded, instead of fetc…
This commit is contained in:
Gregory Sanders 2017-08-10 07:38:43 -04:00 committed by GitHub
commit 4985bc5092

View file

@ -168,7 +168,9 @@ UniValue getnewblockhex(const JSONRPCRequest& request)
+ HelpExampleCli("getnewblockhex", "")
);
std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(Params()).CreateNewBlock(CScript() << OP_TRUE));
CScript feeDestinationScript = Params().CoinbaseDestination();
if (feeDestinationScript == CScript()) feeDestinationScript = CScript() << OP_TRUE;
std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(Params()).CreateNewBlock(feeDestinationScript));
if (!pblocktemplate.get())
throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet keypool empty");
{