dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

Masternode start/start-many privkey not checked #443

Closed scratchy closed 8 years ago

scratchy commented 9 years ago

Hey,

Currently its possible to start a masternode even if the masternodeprivkey is not matching on both sides (the wallet and the daemon). Is there any possibility that theres only a successful register/start if they both match?

UdjinM6 commented 9 years ago

its possible to start a masternode even if the masternodeprivkey is not matching on both sides (the wallet and the daemon)

That is simply not true, masternode will not activate itself if keys in broadcasted message don't match. It will have no idea which vin is its own (if MN is new or it was really dropped out of the list on whole network).

Please rephrase your question and/or give more info.

schinzelh commented 9 years ago

@UdjinM6 fully agree, the question/assumption is not correct.

@scratchy running a "masternode start" or "masternode start-many" command on the wallet does NOT mean that the deamon IS started - these commands only send out a "dsee" message to the network, which the daemon will pick up (if matching the privkey) and change to ENABLED state and start pinging ("dseep").

The message "masternode started sucessfully" on wallet console may be misleading here, we should think about to rephrase it.

scratchy commented 9 years ago

okay i checked it again:

What is did:

Daemon side:

Wallet side:

Network-Side:

Now the the node appears instantly with "ENABLED", even if the both use two different privkeys. Also i guess in this case the node is payed only for appearing in the list #442. (I didnt verified it, only refering to 3rd party information)

Yes i know its not the normal case how its used and surely the node will disappear after a given timeout (currently 1 hour ?). But shouldnt be there an additional stage like PRE_ENABLED or something?

UdjinM6 commented 9 years ago

Ah, I see now. Well, that's exactly how it works. However to get payed MN have to be activated and periodically send pings. It will have to wait next 4+ days to get payed but will be delisted after 1 hour if it wasn't activated. So, yeah, that smth like PRE_ENABLED. I agree, that can be confusing. I'll have a look what we can do to (at least visually) fix it.

scratchy commented 9 years ago

If i get the code right, it should be easy to implement.

https://github.com/dashpay/dash/blob/v0.12.0.x/src/rpcmasternode.cpp#L577

As long as this is 0 the node was never online and ENABLED should be PRE_ENABLED ?

UdjinM6 commented 9 years ago

postponed till v12.1, see #484

schinzelh commented 8 years ago

As this is addressed in #561 i consider this fixed and will close it