-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
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){ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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... :)
Merged, thanks! |
you guys are hardcore :) |
@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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
@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(); |
There was a problem hiding this comment.
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. 😎
There was a problem hiding this comment.
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).
Let's move discussion to #744 😄 |
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
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.confcreate-all
- Create remote masternode broadcast messages for all masternodes configured in masternode.confdecode
- Decode masternode broadcast messagerelay
- Relay masternode broadcast message to the network