Page MenuHomePhabricator

[backport#15644] Simplify orphan processing in preparation for interruptibility
ClosedPublic

Authored by majcosta on May 21 2020, 23:38.

Details

Summary
Test Plan
ninja check
./test/functional/test_runner.py --extended

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

deadalnix requested changes to this revision.May 22 2020, 00:15
deadalnix added a subscriber: deadalnix.

There is clearly some txid confusion that needs to be cleared before this can proceed.

src/net_processing.cpp
2815

Why do you need a conversion here? This is wrong, that means you got to convert some code to use txid first (or worse, this isn't not meant to be a txid and then you created a problem).

2832

Is it the hash of the txid?

This revision now requires changes to proceed.May 22 2020, 00:15
nakihito requested changes to this revision.May 22 2020, 00:31
nakihito added a subscriber: nakihito.
nakihito added inline comments.
src/net_processing.cpp
2832

This is a TxId not a TxHash, so it should still be named orphanId.

rebased, made a couple implicit narrowing conversions in the construction of COutPoint explicit

deadalnix requested changes to this revision.May 22 2020, 21:14
deadalnix added inline comments.
src/net_processing.cpp
2809 ↗(On Diff #20536)
uint32_t(i)

Also not sure about the {}. Why the change?

2862 ↗(On Diff #20536)

dito

This revision now requires changes to proceed.May 22 2020, 21:14
src/net_processing.cpp
2809 ↗(On Diff #20536)

this is what is actually happening under the hood: we're doing a narrowing conversion from size_t (unsigned long int on my machine) to uint32_t (unsigned int)

the list initializer forces us to be be explicit about that and will error out if you remove the static_cast

rebase, addressed feedback

deadalnix added inline comments.
src/net_processing.cpp
2809 ↗(On Diff #20551)

I would recommend using a regular constructor instead of the curly braces things.

2862 ↗(On Diff #20551)

dito

This revision is now accepted and ready to land.May 22 2020, 22:31