Page MenuHomePhabricator

[refactor] change orphan txs std::map member to use TxId instead of uint256
ClosedPublic

Authored by majcosta on May 22 2020, 15:12.

Details

Summary

for type safety. as long as i'm touching those lines, I also added
auto liberally and const where appropriate

Test Plan
ninja check-extended

Event Timeline

deadalnix requested changes to this revision.May 22 2020, 15:25
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/net_processing.cpp
1063 ↗(On Diff #20513)

So it's not a hash, is it?

1131 ↗(On Diff #20513)

So it is not a random hash, is it?

2891 ↗(On Diff #20513)

dito

This revision now requires changes to proceed.May 22 2020, 15:25

addressed comments, added more explicit names, replaced a constructor initialization with list initialization to guard against narrowind conversions, made a TxId function parameter const

deadalnix requested changes to this revision.May 22 2020, 17:24
deadalnix added inline comments.
src/net_processing.cpp
1029 ↗(On Diff #20516)

TxId is not any longer than auto and make things clearer.

1131 ↗(On Diff #20516)

const TxId randomTxId(rng.rand256());

1251 ↗(On Diff #20516)

TxId also, orphanId to match naming in the source material.

1260 ↗(On Diff #20516)

revert

2891 ↗(On Diff #20516)

just txid

This revision now requires changes to proceed.May 22 2020, 17:24
This revision is now accepted and ready to land.May 22 2020, 17:52