HomePhabricator

CreateNewBlock: small tweaks

Description

CreateNewBlock: small tweaks

Summary:
This does a mild optimization by pre-reserving the pblock->vtx transaction
refs list; the iteration variable is renamed.

Also the FIXMEs are removed. T479 seems to worry about entire transactions
being copied, but in fact we're only dealing in transaction references.
I don't think we can really do any better than this and in fact, the vector of
CBlockTemplateEntry is (as far as I can tell) exactly that, a zipped list.

Note that outside of this function, the .tx field of CBlockTemplateEntry
is totally unused, and we could perhaps consider moving instead of copying
the transaction refs (leaving all the .tx fields as null). I've tried this
and it doesn't seem to give any speedup to miner_tests.

Depends on D5019.

Test Plan: ninja check

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5022

Details

Provenance
Mark Lundeberg <markblundeberg@users.noreply.github.com>Authored on Jan 19 2020, 05:50
markblundebergPushed on Jan 21 2020, 08:44
Reviewer
Restricted Project
Differential Revision
D5022: CreateNewBlock: small tweaks
Parents
rABC8217e774678f: CreateNewBlock: insert entries into block slightly earlier so that correct sizeā€¦
Branches
Unknown
Tags
Unknown

Event Timeline

Mark Lundeberg <markblundeberg@users.noreply.github.com> committed rABCe3b6c342601d: CreateNewBlock: small tweaks (authored by Mark Lundeberg <markblundeberg@users.noreply.github.com>).Jan 21 2020, 08:44