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 deadlock in CSigSharesManager::SendMessages #2757

Merged
merged 2 commits into from
Mar 11, 2019

Conversation

codablock
Copy link

Locking "cs" at this location caused a (potential) deadlock due to changed
order of cs and cs_vNodes locking. This changes the method to not require
the session object anymore which removes the need for locking.

@UdjinM6
Copy link

UdjinM6 commented Mar 11, 2019

Why not just set llmqType in CBatchedSigShares::ToInv() to Consensus::LLMQ_400_60 by default instead of introducing ToInvString()?

@codablock
Copy link
Author

@UdjinM6 I thought ToInvStr() was more clear in the use of LLMQ_400_60, which is actually kind of a hack (we're passing the wrong type here...).

@UdjinM6
Copy link

UdjinM6 commented Mar 11, 2019

True, it's hack-ish :) But the funny thing is that ToInv() is never actually used for anything else but to produce strings.

@codablock
Copy link
Author

Yeah that's true...that was different in the past but now it's a leftover that's actually not needed. I'll remove ToInv completely now.

Locking "cs" at this location caused a (potential) deadlock due to changed
order of cs and cs_vNodes locking. This changes the method to not require
the session object anymore which removes the need for locking.
UdjinM6
UdjinM6 previously approved these changes Mar 11, 2019
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK

@UdjinM6 UdjinM6 added this to the 14.0 milestone Mar 11, 2019
This allows use of sizes which are not supported in chainparams.
@codablock
Copy link
Author

Turned out that the last changes I did caused a crash due to LLMQ_400_60 not known on regtest. Changed CSigSharesInv::Init now to use size as parameter instead of llmqType.

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK

@UdjinM6 UdjinM6 merged commit 588eb30 into dashpay:develop Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants