diff options
Diffstat (limited to 'src/rpcmining.cpp')
-rw-r--r-- | src/rpcmining.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 49c5c3ca58..6f165028d5 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -475,7 +475,7 @@ Value getblocktemplate(const Array& params, bool fHelp) // Store the pindexBest used before CreateNewBlock, to avoid races nTransactionsUpdatedLast = mempool.GetTransactionsUpdated(); - CBlockIndex* pindexPrevNew = chainActive.Tip(); + CBlockIndex* pindexPrevNew; nStart = GetTime(); // Create new block @@ -485,7 +485,7 @@ Value getblocktemplate(const Array& params, bool fHelp) pblocktemplate = NULL; } CScript scriptDummy = CScript() << OP_TRUE; - pblocktemplate = CreateNewBlock(scriptDummy); + pblocktemplate = CreateNewBlock(scriptDummy, pindexPrevNew); if (!pblocktemplate) throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory"); |