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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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