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
Branch
master
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9513
Build 16938: Default Diff Build & Tests
Build 16937: arc lint + arc unit

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

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

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