Skip to content

Commit

Permalink
Merge #6496: refactor: drop unneccessary if guard
Browse files Browse the repository at this point in the history
d7e3076 refactor: drop unneccessary if guard (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  If it's empty, it'll just not iterate through anything

  ## What was done?

  ## How Has This Been Tested?
  Built

  ## Breaking Changes

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK d7e3076

Tree-SHA512: bbe11001835006f0892d3630febf131ca4f00c3dda5facf3c4d19cd11b77a2013575fa735f7889bca787da16657aad3202219b9bd3c9f594ddcfd3f297f158f0
  • Loading branch information
PastaPastaPasta committed Dec 24, 2024
2 parents ad7a373 + d7e3076 commit 2bd4703
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/llmq/signing_shares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,16 +739,14 @@ void CSigSharesManager::ProcessSigShare(PeerManager& peerman, const CSigShare& s
// Update the time we've seen the last sigShare
timeSeenForSessions[sigShare.GetSignHash()] = GetTime<std::chrono::seconds>().count();

if (!quorumNodes.empty()) {
// don't announce and wait for other nodes to request this share and directly send it to them
// there is no way the other nodes know about this share as this is the one created on this node
for (auto otherNodeId : quorumNodes) {
auto& nodeState = nodeStates[otherNodeId];
auto& session = nodeState.GetOrCreateSessionFromShare(sigShare);
session.quorum = quorum;
session.requested.Set(sigShare.getQuorumMember(), true);
session.knows.Set(sigShare.getQuorumMember(), true);
}
// don't announce and wait for other nodes to request this share and directly send it to them
// there is no way the other nodes know about this share as this is the one created on this node
for (auto otherNodeId : quorumNodes) {
auto& nodeState = nodeStates[otherNodeId];
auto& session = nodeState.GetOrCreateSessionFromShare(sigShare);
session.quorum = quorum;
session.requested.Set(sigShare.getQuorumMember(), true);
session.knows.Set(sigShare.getQuorumMember(), true);
}

size_t sigShareCount = sigShares.CountForSignHash(sigShare.GetSignHash());
Expand Down

0 comments on commit 2bd4703

Please sign in to comment.