mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Merge #7598: Refactor CreateNewBlock to be a method of the BlockAssembler class
c2dd5a3FIX: correctly measure size of priority block (Alex Morcos)a278764FIX: Account for txs already added to block in addPriorityTxs (Alex Morcos)4dc94d1Refactor CreateNewBlock to be a method of the BlockAssembler class (Alex Morcos)
This commit is contained in:
commit
e1486eb95c
5 changed files with 333 additions and 206 deletions
|
|
@ -112,7 +112,7 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nG
|
|||
UniValue blockHashes(UniValue::VARR);
|
||||
while (nHeight < nHeightEnd)
|
||||
{
|
||||
std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlock(Params(), coinbaseScript->reserveScript));
|
||||
std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(Params()).CreateNewBlock(coinbaseScript->reserveScript));
|
||||
if (!pblocktemplate.get())
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block");
|
||||
CBlock *pblock = &pblocktemplate->block;
|
||||
|
|
@ -527,7 +527,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||
pblocktemplate = NULL;
|
||||
}
|
||||
CScript scriptDummy = CScript() << OP_TRUE;
|
||||
pblocktemplate = CreateNewBlock(Params(), scriptDummy);
|
||||
pblocktemplate = BlockAssembler(Params()).CreateNewBlock(scriptDummy);
|
||||
if (!pblocktemplate)
|
||||
throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue