Partially reverts ff69e0d57512779599708c71609dd3304962284e from https://github.com/dashpay/dash/pull/5336 due to Span<CNode*>'s incompatibility with CConnman::NodesSnapshot::Snap() (returning const std::vector<CNode*>&)
masternode/sync.cpp:147:18: error: no matching member function for call to 'RequestGovernanceObjectVotes'
m_govman.RequestGovernanceObjectVotes(snap.Nodes(), connman);
~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./governance/governance.h:360:9: note: candidate function not viable: no known conversion from 'const
std::vector<CNode *>' to 'CNode &' for 1st argument
int RequestGovernanceObjectVotes(CNode& peer, CConnman& connman) const;
^
./governance/governance.h:361:9: note: candidate function not viable: no known conversion from 'const std::vector<CNode *>' to 'Span<CNode *>' for 1st argument
int RequestGovernanceObjectVotes(Span<CNode*> vNodesCopy, CConnman& connman) const;
^
1 error generated.
Dash already implements its own CNode* iteration logic in dash#1382 and implemented additional capabilities in dash#1575, which meant backporting bitcoin#21943 involved migrating Dash-specific code to upstream logic that needed to be modified to implement expected functionality.
Unlike Bitcoin, Dash maintains a map of every raw SOCKET corresponding to a pointer of their CNode instance and uses it to translate socket sets to their corresponding CNode* sets. This is done to accommodate for edge-triggered modes which have an event-socket relationship, as opposed to level-triggered modes, which have a socket-event relationship.
This means that CConnman::SocketHandlerConnected() doesn't require access to a vector of all CNode pointers and therefore, the argument nodes has been omitted.
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 (note: N/A)
[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)
Additional Information
Dependent on https://github.com/dashpay/dash/pull/6001
Dependency for https://github.com/dashpay/dash/pull/6018
Partially reverts ff69e0d57512779599708c71609dd3304962284e from https://github.com/dashpay/dash/pull/5336 due to
Span<CNode*>
's incompatibility withCConnman::NodesSnapshot::Snap()
(returningconst std::vector<CNode*>&
)Dash already implements its own
CNode*
iteration logic in dash#1382 and implemented additional capabilities in dash#1575, which meant backporting bitcoin#21943 involved migrating Dash-specific code to upstream logic that needed to be modified to implement expected functionality.Unlike Bitcoin, Dash maintains a map of every raw
SOCKET
corresponding to a pointer of theirCNode
instance and uses it to translate socket sets to their correspondingCNode*
sets. This is done to accommodate for edge-triggered modes which have an event-socket relationship, as opposed to level-triggered modes, which have a socket-event relationship.This means that
CConnman::SocketHandlerConnected()
doesn't require access to a vector of allCNode
pointers and therefore, the argumentnodes
has been omitted.Checklist: