mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Bugfix: make CreateNewBlock return pindexPrev
This commit is contained in:
parent
6b04508e37
commit
e2edf95cd3
4 changed files with 26 additions and 25 deletions
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue