Page MenuHomePhabricator

[ConnectBlock] Use an index to refers into blockundo.vtxundo rather than pusing as we go
ClosedPublic

Authored by deadalnix on Feb 15 2020, 16:43.

Details

Summary

This makes the code more solid as there is no risk of reallocation mid way.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jasonbcox requested changes to this revision.Feb 15 2020, 17:02
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/validation.cpp
1912 ↗(On Diff #16409)

Any reason to not move this initialization down to where txIndex is initialized? It isn't used until that loop anyway, and block.vtx.size() doesn't change.

This revision now requires changes to proceed.Feb 15 2020, 17:02
deadalnix added inline comments.
src/validation.cpp
1912 ↗(On Diff #16409)

This is where everything is setup. If anything we'd have to move the other loop up, but this doesn't seem like the best move for this patch.

This revision is now accepted and ready to land.Feb 15 2020, 17:42