freynder/darkcoin — pull request #1 by freynder (2014-12-12 04:56:11+00:00)
Title: Improve support for start-many:

To be able to better manage many masternode, I reviewed the masternode spawning code and propose here a few changes. To be able to implement this I needed to refactored most of the CActiveMasternode code to make it more clear and modular.

The proposed change now supports a new masternode.conf format. Each line consisting of an alias, address, private key, collateral output transaction and collateral output index.

Example:

mn1 127.0.0.2:19999 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0
mn2 127.0.0.3:19999 93WaAb3htPJEV8E9aQcN23Jt97bPex7YvWfgMDTUdWJvzmrMqey aa9f1034d973377a5e733272c3d0eced1de22555ad45d6b24abadff8087948d4 0
mn3 127.0.0.4:19999 92Da1aYg6sbenP6uwskJgEY2XWB5LwJ7bXRqc3UPeShtHWJDjDv db478e78e3aefaa8c12d12ddd0aeace48c3b451a8b41c570d0ee375e2a02dfd9 1
In the example above, the collateral for mn1 consists of transcation:
http://test.explorer.darkcoin.fr/tx/2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c
output index 0 has amount 1000

The following new RPC commands are supported:

list-conf: shows the parsed masternode.conf
start-alias
stop-alias
start-many
stop-many
When using these new remote commands, I would suggest changing the hot wallet config to 'masternode=0' as it is not needed anymore.

Please note that the stop commands do not seem to have much effect currently, but this is already the case in the current implementation. Basically, the dseep is being sent but it is ignored by DOS protection on the receiving side (darkcoin.cpp), but this is outside the scope of this.

I'm still getting up to speed with using C++ and understanding the codebase, so there might be some issues. Basic testing was performed, but a detailed review and lot of additional testing would be needed I suppose.

This is my first contribution, I hope to be able to contribute more in the future.