From 7e1701899534151972ddff3c08cc964a9db64bc5 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 24 Aug 2013 00:33:46 -0400 Subject: CreateNewBlock() now takes scriptPubKey argument, rather than a key. CreateNewBlockWithKey() helper is added to restore existing functionality, making this an equivalent-transformation change. --- src/rpcmining.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/rpcmining.cpp') diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 25111d378..8b562680a 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -149,7 +149,7 @@ Value getwork(const Array& params, bool fHelp) nStart = GetTime(); // Create new block - pblocktemplate = CreateNewBlock(*pMiningKey); + pblocktemplate = CreateNewBlockWithKey(*pMiningKey); if (!pblocktemplate) throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); vNewBlockTemplate.push_back(pblocktemplate); @@ -280,7 +280,7 @@ Value getblocktemplate(const Array& params, bool fHelp) delete pblocktemplate; pblocktemplate = NULL; } - pblocktemplate = CreateNewBlock(*pMiningKey); + pblocktemplate = CreateNewBlockWithKey(*pMiningKey); if (!pblocktemplate) throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); -- cgit v1.2.3 From 7bb0f6c5e89a4d5c9a6ef42f5643f42646da44c9 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 24 Aug 2013 00:45:17 -0400 Subject: RPC: getblocktemplate does not require a key, to create a block template getblocktemplate only uses certain portions of the coinbase transaction, notably ignoring the coinbase TX output entirely. Use CreateNewBlock() rather than CreateNewBlockWithKey(), eliminating the needless key passing. Should be zero behavior changes. --- src/rpcmining.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/rpcmining.cpp') diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 8b562680a..c7f516caa 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -280,7 +280,8 @@ Value getblocktemplate(const Array& params, bool fHelp) delete pblocktemplate; pblocktemplate = NULL; } - pblocktemplate = CreateNewBlockWithKey(*pMiningKey); + CScript scriptDummy = CScript() << OP_TRUE; + pblocktemplate = CreateNewBlock(scriptDummy); if (!pblocktemplate) throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); -- cgit v1.2.3