Skip to content

Commit c77216e

Browse files
committed
docs: explain meaning of MessageProcessingResult's members
1 parent d0f1778 commit c77216e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/protocol.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,32 @@ struct MisbehavingError
579579
{}
580580
};
581581

582+
// TODO: replace usages of PeerMsgRet to MessageProcessingResult which is cover this one
582583
using 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+
*/
584596
struct 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;

0 commit comments

Comments
 (0)