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

feat(rpc): introduce and use setmnthreadactive (regtest-only) #6286

Merged
merged 3 commits into from
Sep 25, 2024

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Sep 25, 2024

Issue being fixed or feature implemented

This adds a new rpc command to enable/disable automatic masternode connections creation. We need this for #6276. 1e17b74 is extracted from ede1833 to avoid multiple jobs calling setmnthreadactive on the same node in parallel.

What was done?

Add setmnthreadactive rpc and use it

How Has This Been Tested?

run tests

Breaking Changes

n/a

Checklist:

  • 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
  • I have assigned this pull request to a milestone

@UdjinM6 UdjinM6 added the RPC Some notable changes to RPC params/behaviour/descriptions label Sep 25, 2024
@UdjinM6 UdjinM6 added this to the 21.2 milestone Sep 25, 2024
Copy link
Collaborator

@kwvg kwvg left a comment

Choose a reason for hiding this comment

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

LGTM, ACK 1e17b74

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 1e17b74

{

if (Params().NetworkIDString() != CBaseChainParams::REGTEST) {
throw std::runtime_error("setmnthreadactive is for regression testing (-regtest mode) only.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

should not it be JSONRPCError?

Copy link
Author

Choose a reason for hiding this comment

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

For whatever reason all such messages are thrown this way 🤷‍♂️
https://github.com/search?q=repo%3Abitcoin%2Fbitcoin+%22%28-regtest+mode%29%22&type=code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RPC Some notable changes to RPC params/behaviour/descriptions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants