You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #6820: refactor: migrate ProcessMessage definitions to MessageProcessingResult, drop PeerMsgRet
491ae50 revert: new util class `expected` for return errors by more convenient way (Kittywhiskers Van Gogh)
2020757 trivial: remove `PeerMsgRet` handling logic (Kittywhiskers Van Gogh)
5d1222e chore: drop govobj/govobjvote counts, use `ret.m_inventory.size()` (UdjinM6)
4822b93 refactor: allow submitting multiple `CInv`s to `MessageProcessingResult` (Kittywhiskers Van Gogh)
0517aff refactor: mark `RelayInv{,Filtered}`'s `CInv` argument as const (Kittywhiskers Van Gogh)
9084530 refactor: migrate `CGovernanceManager::ProcessMessage()` and friends (Kittywhiskers Van Gogh)
8b9bf7c refactor: migrate `CCoinJoinServer::ProcessMessage()` (Kittywhiskers Van Gogh)
1d50a1a refactor: migrate `CCoinJoinClientQueueManager::ProcessMessage()` (Kittywhiskers Van Gogh)
6352baf refactor: migrate `CMNAuth::ProcessMessage()` (Kittywhiskers Van Gogh)
9f85bd0 refactor: migrate `CInstantSendManager::ProcessMessage()` (Kittywhiskers Van Gogh)
ef4a0bb refactor: migrate `CDKGSessionManager::ProcessMessage()` and friends (Kittywhiskers Van Gogh)
93d68b8 refactor: migrate `CQuorumManager::ProcessMessage()` (Kittywhiskers Van Gogh)
1bbcb95 refactor: migrate `CSporkManager::ProcessMessage()` and friends (Kittywhiskers Van Gogh)
e7b23a2 refactor: migrate `CSigningManager::ProcessMessage()` (Kittywhiskers Van Gogh)
f3b98ce chore: add redefinition of `NodeId` to avoid repetitive redefinition (Kittywhiskers Van Gogh)
f341ef5 chore: add `nodiscard` attrib to `MessageProcessingResult` ret functions (Kittywhiskers Van Gogh)
Pull request description:
## Additional Information
* Dependency for #6821
* To avoid having to redeclare `NodeId` repeatedly to avoid circular dependencies from including `net.h` ([source](https://github.com/dashpay/dash/blob/fb87a5a937dd232d4f2ae60b5b8c5c29d49cb92f/src/net.h#L121)), a redeclaration is made in the relatively lightweight `net_types.h` that as of `develop` (fb87a5a), doesn't have includes outside the standard library ([source](https://github.com/dashpay/dash/blob/fb87a5a937dd232d4f2ae60b5b8c5c29d49cb92f/src/net_types.h#L8-L10)).
Redeclarations were flagged during review (see [comment](#6820 (comment)), [comment](#6820 (comment))).
* As `tl::expected` was introduced alongside `PeerMsgRet` in [dash#5782](#5782) and has not been used elsewhere, we can safely remove it as we've finished migrating all usage to `MessageProcessingResult`.
## Breaking Changes
None expected.
## Checklist
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
- [x] I have added or updated relevant unit/integration/functional/e2e tests
- [x] I have made corresponding changes to the documentation **(note: N/A)**
- [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
ACKs for top commit:
knst:
utACK 491ae50
UdjinM6:
utACK 491ae50
Tree-SHA512: c37fe6370555f1c33877fa5a335356e2febf25c2d0d954fa44623f49994647ea2a10aec5ceb9e788bb6fa9315dc00b3e54ca8e0da96c7899fb31c30b888eb732
if (auto dmn = tip_mn_list.GetValidMN(dsq.m_protxHash)) {
131
130
dsq.masternodeOutpoint = dmn->collateralOutpoint;
132
131
} else {
133
-
return tl::unexpected{10};
132
+
ret.m_error = MisbehavingError{10};
133
+
return ret;
134
134
}
135
135
}
136
136
137
137
{
138
138
TRY_LOCK(cs_vecqueue, lockRecv);
139
-
if (!lockRecv) return{};
139
+
if (!lockRecv) returnret;
140
140
141
141
// process every dsq only once
142
142
for (constauto& q : vecCoinJoinQueue) {
143
143
if (q == dsq) {
144
-
return{};
144
+
returnret;
145
145
}
146
146
if (q.fReady == dsq.fReady && q.masternodeOutpoint == dsq.masternodeOutpoint) {
147
147
// no way the same mn can send another dsq with the same readiness this soon
148
-
LogPrint(BCLog::COINJOIN, "DSQUEUE -- Peer %s is sending WAY too many dsq messages for a masternode with collateral %s\n", peer.GetLogString(), dsq.masternodeOutpoint.ToStringShort());
149
-
return{};
148
+
LogPrint(BCLog::COINJOIN, "DSQUEUE -- Peer %d is sending WAY too many dsq messages for a masternode with collateral %s\n", from, dsq.masternodeOutpoint.ToStringShort());
0 commit comments