File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -579,13 +579,32 @@ struct MisbehavingError
579579 {}
580580};
581581
582+ // TODO: replace usages of PeerMsgRet to MessageProcessingResult which is cover this one
582583using PeerMsgRet = tl::expected<void , MisbehavingError>;
583584
585+ /* *
586+ * This struct is a helper to return values from handlers that are processing
587+ * network messages but implemented outside of net_processing.cpp,
588+ * for example llmq's messages.
589+ *
590+ * These handlers do not supposed to know anything about PeerManager to avoid
591+ * circular dependencies.
592+ *
593+ * See `PeerManagerImpl::PostProcessMessage` to see how each type of return code
594+ * is processed.
595+ */
584596struct MessageProcessingResult
585597{
598+ // ! @m_error triggers Misbehaving error with score and optional message if not nullopt
586599 std::optional<MisbehavingError> m_error;
600+
601+ // ! @m_inventory will relay this inventory to connected peers if not nullopt
587602 std::optional<CInv> m_inventory;
603+
604+ // ! @m_transactions will relay transactions to peers which is ready to accept it (some peers does not accept transactions)
588605 std::vector<uint256> m_transactions;
606+
607+ // ! @m_to_erase triggers EraseObjectRequest from PeerManager for this inventory if not nullopt
589608 std::optional<CInv> m_to_erase;
590609
591610 MessageProcessingResult () = default ;
You can’t perform that action at this time.
0 commit comments