The processor PeerData is currently a nullable pointer which is only
constructed if a proof is supplied.
This diff makes the PeerData a permanent member of the processor and
change the proof and delegation to be optional. This will allow for
adding other non optional members to the PeerData structure and extract
its initialization from the Processor.
Details
ninja all check-all
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- avalanche_peer_data_optional_proof
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 15526 Build 30972: Build Diff build-diff · build-without-wallet · lint-circular-dependencies · build-debug · build-clang · build-clang-tidy Build 30971: arc lint + arc unit
Event Timeline
src/avalanche/processor.h | ||
---|---|---|
304 ↗ | (On Diff #28189) | The doxygen documentation is now wrong and should be fixed. In D9394 I renamed it to getLocalProof, because I anticipate that getProof will at some point be needed to get any proof from the peerset or orphan proofs, to relay them. |
Address comment:
- Update doxygen doc
- Rename getProof => getLocalProof which is more accurate
Also make the proof optional a reference in init.cpp
The rationale of this patch doesn't rally make sense. If data aren't optional, then don't put them in the PeerData. If the name turn out to b confusing then rename.
src/avalanche/processor.h | ||
---|---|---|
251 | In what world can we have a delegation but no proof? I don't think this reflect the set of constraints we want here. Th optional smart pointer was best. | |
src/init.cpp | ||
2456 | Why would we expect our g_avalanche to contain an invalid proof? Why do we delegate to the network layer the responsibility to check proof validity (and, as an asside, this is duplicated from the initialization code, or at least there was an attempt, so you KNOW this doesn't make sense, the code is telling you). |