Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: A set of qdata/qwatch related fixes #5745

Merged
merged 7 commits into from
Jan 10, 2024
5 changes: 5 additions & 0 deletions src/llmq/dkgsessionmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ void CDKGSessionManager::ProcessMessage(CNode& pfrom, const CQuorumManager& quor
}

if (msg_type == NetMsgType::QWATCH) {
if (!fMasternodeMode) {
// non-masternodes should never receive this
m_peerman->Misbehaving(pfrom.GetId(), 10);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a notice: refactored in #5782 - one of these 2 PR should be changed after other is merged

return;
}
pfrom.qwatch = true;
return;
}
Expand Down
7 changes: 7 additions & 0 deletions test/functional/p2p_quorum_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def test_basics():
"and does bump our score")
p2p_node0.test_qgetdata(qgetdata_all, response_expected=False)
wait_for_banscore(node0, id_p2p_node0, 10)
self.log.info("Check that normal node bumps our score for qwatch")
p2p_node0.send_message(msg_qwatch())
wait_for_banscore(node0, id_p2p_node0, 20)
# The masternode should not respond to qgetdata for non-masternode connections
self.log.info("Check that masternode doesn't respond to "
"non-masternode connection and does bump our score")
Expand Down Expand Up @@ -383,6 +386,10 @@ def test_watchquorums():
p2p_node0.wait_for_qmessage("qgetdata")
p2p_node0.send_message(p2p_mn2.get_qdata())
wait_for_banscore(node0, id_p2p_node0, (1 - len(extra_args)) * 10)
# Non-masternodes should bump peer's score for qwatch no matter
# whether they (non-masternodes) are watching or not.
p2p_node0.send_message(msg_qwatch())
wait_for_banscore(node0, id_p2p_node0, (1 - len(extra_args)) * 10 + 10)
node0.disconnect_p2ps()
mn2.node.disconnect_p2ps()

Expand Down