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"); {