mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Bugfix: make CreateNewBlock return pindexPrev
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user