Page MenuHomePhabricator

CreateNewBlock: small tweaks
ClosedPublic

Authored by markblundeberg on Jan 19 2020, 05:55.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABCe3b6c342601d: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.