dcrd/internal
Dave Collins 517091c7f6
netsync: Export opaque peer and require it in API.
Currently the sync manager maintains additional state per peer in an
internal struct that wraps a base/common peer as well as a mapping keyed
by that base/common peer.  The internal wrapped peer is then queried
each time it is needed.  This leads to code that is harder to reason
about and can fail to lookup the necessary state in some hard to hit
corner cases.

With that in mind, this modifies the sync manager semantics to instead
export the wrapped peer and require the caller to provide that wrapped
peer in all of its APIs directly.  The server then creates and stores
the wrapped peer instance at connection time and passes it to the sync
manager.

The end result is the code is easier to reason about and resolves the
aforementioned hard to hit corner cases since it is no longer possible
for the sync manager to ever have access to a peer without the
associated extra state.
2023-10-28 01:51:49 -05:00
..
blockchain multi: Consolidate waitgroup logic. 2023-10-28 01:48:52 -05:00
fees multi: Wrap errors for better errors.Is/As support. 2023-08-25 16:31:11 -05:00
integration/rpctests build: Add CI support for test and module cache. 2023-06-19 14:18:30 -05:00
limits main: Remove old style build constraints. 2022-12-05 09:04:01 -06:00
mempool multi: Remove a bunch of dup words in comments. 2023-08-23 14:13:51 -05:00
mining multi: Consolidate waitgroup logic. 2023-10-28 01:48:52 -05:00
netsync netsync: Export opaque peer and require it in API. 2023-10-28 01:51:49 -05:00
progresslog multi: Go 1.19 doc comment formatting. 2022-07-30 04:08:58 -05:00
rpcserver multi: Consolidate waitgroup logic. 2023-10-28 01:48:52 -05:00
staging multi: Wrap errors for better errors.Is/As support. 2023-08-25 16:31:11 -05:00
version release: Bump for 1.9 release cycle. 2023-06-09 12:05:49 -05:00