Introduce Sv2Transport #27
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces
Sv2Transport, a new subclass ofTransport.It's most similar to
V2Transport, though with a simpler state machine.In order to make it easier in the future to move the Stratum v2 integration to its own process, this PR also moves
Transportout ofnet.hand makes it part ofbitcoin-common.This also makes for a nice decluttering of net.{h,cpp}, and useful for utilities that need a one-shot p2p connection, e.g. to fetch a specific block.
It would also allow the wallet to make a one-shot tor connection to broadcast a transaction without going through the node mempool. Though this would require a lot more changes.
Once the
Sv2Transportclass in this PR works, and the Template Provider switched to use it, I plan to rewrite the history of the main PR bitcoin#28983. The move-only commits should not change in that process.