Page MenuHomePhabricator

CreateNewBlock: small tweaks
ClosedPublic

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

Details

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
Branch
miner_log_fix
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9063
Build 16088: Default Diff Build & Tests
Build 16087: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jan 19 2020, 16:53