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

Implemented masternodebroadcast #741

Closed
wants to merge 1 commit into from
Closed

Implemented masternodebroadcast #741

wants to merge 1 commit into from

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Mar 16, 2016

This set of rpc commands provide an ability to create masternode broadcast messages offline and relay them from online node later (messages expire in ~1 hour).

Available commands:

  • create-alias - Create single remote masternode broadcast message by assigned alias configured in masternode.conf
  • create-all - Create remote masternode broadcast messages for all masternodes configured in masternode.conf
  • decode - Decode masternode broadcast message
  • relay - Relay masternode broadcast message to the network

This set of rpc commands provide an ability to create masternode broadcast messages offline
and relay them from online node later (messages expire in ~1 hour).

Arguments:
1. command        (string or set of strings, required) The command to execute
2. passphrase     (string, optional) The wallet passphrase
Available commands:
  create-alias  - Create single remote masternode broadcast message by assigned alias configured in masternode.conf
  create-all    - Create remote masternode broadcast messages for all masternodes configured in masternode.conf
  decode        - Decode masternode broadcast message
  relay         - Relay masternode broadcast message to the network
@@ -190,11 +190,6 @@ void CMasternode::Check(bool forceCheck)
//once spent, stop doing the checks
if(activeState == MASTERNODE_VIN_SPENT) return;

if(lastPing.sigTime - sigTime < MASTERNODE_MIN_MNP_SECONDS){

Choose a reason for hiding this comment

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

What happened here that required these to be moved? Just curious

Copy link
Author

Choose a reason for hiding this comment

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

pre_enabled masternodes were sitting there forever... :)

@schinzelh schinzelh closed this in eaf57b3 Mar 17, 2016
@schinzelh
Copy link

Merged, thanks!

@ghost
Copy link

ghost commented Mar 17, 2016

you guys are hardcore :)

@eduffield222
Copy link

@schinzelh Can we start voting on these before merging? I wasn't done with the code review and I want to be much more careful about merging after 12.1

return resultObj;
}

if (strCommand == "relay")

Choose a reason for hiding this comment

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

Can we improve the flow of use for this? I was thinking it should dump a huge serialized array, then all you do is decode the array and process each of the signed messages and relay? We would just dump the hex of the array... sound good?

Copy link
Author

Choose a reason for hiding this comment

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

You mean create an array (vector?) and serialize it in create-all, right? And then update decode and relay to the same format? I think it's a good idea and can be improved this way imo. One thing I'm not sure about is will the size of it for say 10+ masternodes fit in the console? I guess we could just give it a try and see what happens :)

@UdjinM6 UdjinM6 deleted the rpcmasternodebroadcast branch March 17, 2016 15:48
@UdjinM6
Copy link
Author

UdjinM6 commented Mar 17, 2016

@evan82 agree on PR's voting but I would also like to see no more direct commit pushing (when there is no PR at all) even in dev branches 😛

throw JSONRPCError(RPC_INVALID_PARAMETER, "Masternode broadcast signature verification failed");

mnodeman.UpdateMasternodeList(mnb);
mnb.Relay();

Choose a reason for hiding this comment

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

I think we should use something like mnb.CheckInputsAndAdd(nDos) instead of UpdateMasternodeList + Relay because we should really check the mnb before relay to network. 😎

Copy link
Author

Choose a reason for hiding this comment

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

Hmm... might be a good idea.. though I was thinking that relaying your own messages doesn't really need additional verifications (specifically the ones that are somewhat cpu expensive).

@UdjinM6
Copy link
Author

UdjinM6 commented Mar 17, 2016

Let's move discussion to #744 😄

@schinzelh
Copy link

@evan82 sorry, my bad - i was in a merging frenzy :-)

I agree on voting on PRs before merging, and agree on @UdjinM6 that we should not directly commit to upstream without PR - it makes review of codes changes much easier IMHO.

presstab referenced this pull request in presstab/PIVX Dec 6, 2017
This set of rpc commands provide an ability to create masternode broadcast messages offline
and relay them from online node later (messages expire in ~1 hour).

Arguments:
1. command        (string or set of strings, required) The command to execute
2. passphrase     (string, optional) The wallet passphrase
Available commands:
  create-alias  - Create single remote masternode broadcast message by assigned alias configured in masternode.conf
  create-all    - Create remote masternode broadcast messages for all masternodes configured in masternode.conf
  decode        - Decode masternode broadcast message
  relay         - Relay masternode broadcast message to the network

Closes PIVX-Project#741
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants