From a3035b38923539cd1d7e983043c7039e02deb5a7 Mon Sep 17 00:00:00 2001 From: Karl-Johan Alm Date: Wed, 9 Aug 2017 10:18:23 +0900 Subject: [PATCH] getnewblockhex would use regtest coinbase hard coded, instead of fetching CoinbaseDestination from Params. --- src/rpc/mining.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 6975c0de38..c540bcd3e5 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -168,7 +168,9 @@ UniValue getnewblockhex(const JSONRPCRequest& request) + HelpExampleCli("getnewblockhex", "") ); - std::unique_ptr pblocktemplate(BlockAssembler(Params()).CreateNewBlock(CScript() << OP_TRUE)); + CScript feeDestinationScript = Params().CoinbaseDestination(); + if (feeDestinationScript == CScript()) feeDestinationScript = CScript() << OP_TRUE; + std::unique_ptr pblocktemplate(BlockAssembler(Params()).CreateNewBlock(feeDestinationScript)); if (!pblocktemplate.get()) throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet keypool empty"); {