Page MenuHomePhabricator

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

Authored by majcosta on Fri, May 22, 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

majcosta created this revision.Fri, May 22, 15:12
Herald added a reviewer: Restricted Project. · View Herald TranscriptFri, May 22, 15:12
majcosta requested review of this revision.Fri, May 22, 15:12
deadalnix requested changes to this revision.Fri, May 22, 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.Fri, May 22, 15:25
majcosta updated this revision to Diff 20516.Fri, May 22, 15:58

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.Fri, May 22, 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.Fri, May 22, 17:24
majcosta updated this revision to Diff 20527.Fri, May 22, 17:49

addressed comments

deadalnix accepted this revision.Fri, May 22, 17:52
This revision is now accepted and ready to land.Fri, May 22, 17:52