mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
Masternodes should have no wallet enabled (#3084)
This commit is contained in:
parent
6b5b70fab8
commit
68d575dc0d
12
src/init.cpp
12
src/init.cpp
@ -908,6 +908,11 @@ void InitParameterInteraction()
|
||||
// masternodes MUST accept connections from outside
|
||||
gArgs.ForceSetArg("-listen", "1");
|
||||
LogPrintf("%s: parameter interaction: -masternode=1 -> setting -listen=1\n", __func__);
|
||||
#ifdef ENABLE_WALLET
|
||||
// masternode should not have wallet enabled
|
||||
gArgs.ForceSetArg("-disablewallet", "1");
|
||||
LogPrintf("%s: parameter interaction: -masternode=1 -> setting -disablewallet=1\n", __func__);
|
||||
#endif // ENABLE_WALLET
|
||||
if (gArgs.GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS) < DEFAULT_MAX_PEER_CONNECTIONS) {
|
||||
// masternodes MUST be able to handle at least DEFAULT_MAX_PEER_CONNECTIONS connections
|
||||
gArgs.ForceSetArg("-maxconnections", itostr(DEFAULT_MAX_PEER_CONNECTIONS));
|
||||
@ -1900,13 +1905,18 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
|
||||
// ********************************************************* Step 10a: Prepare Masternode related stuff
|
||||
fMasternodeMode = gArgs.GetBoolArg("-masternode", false);
|
||||
// TODO: masternode should have no wallet
|
||||
|
||||
if(fLiteMode && fMasternodeMode) {
|
||||
return InitError(_("You can not start a masternode in lite mode."));
|
||||
}
|
||||
|
||||
if(fMasternodeMode) {
|
||||
#ifdef ENABLE_WALLET
|
||||
if (!vpwallets.empty()) {
|
||||
return InitError(_("You can not start a masternode with wallet enabled."));
|
||||
}
|
||||
#endif //ENABLE_WALLET
|
||||
|
||||
LogPrintf("MASTERNODE:\n");
|
||||
|
||||
std::string strMasterNodeBLSPrivKey = gArgs.GetArg("-masternodeblsprivkey", "");
|
||||
|
@ -143,7 +143,7 @@ class DIP3Test(BitcoinTestFramework):
|
||||
for i in range(20):
|
||||
node = self.nodes[i % len(self.nodes)]
|
||||
self.test_invalid_mn_payment(node)
|
||||
node.generate(1)
|
||||
self.nodes[0].generate(1)
|
||||
self.sync_all()
|
||||
|
||||
self.log.info("testing ProUpServTx")
|
||||
@ -378,7 +378,7 @@ class DIP3Test(BitcoinTestFramework):
|
||||
|
||||
coinbasevalue = bt['coinbasevalue']
|
||||
if miner_address is None:
|
||||
miner_address = node.getnewaddress()
|
||||
miner_address = self.nodes[0].getnewaddress()
|
||||
if mn_payee is None:
|
||||
if isinstance(bt['masternode'], list):
|
||||
mn_payee = bt['masternode'][0]['payee']
|
||||
|
@ -48,23 +48,24 @@ class LLMQChainLocksTest(DashTestFramework):
|
||||
|
||||
# Isolate node, mine on another, and reconnect
|
||||
isolate_node(self.nodes[0])
|
||||
node0_mining_addr = self.nodes[0].getnewaddress()
|
||||
node0_tip = self.nodes[0].getbestblockhash()
|
||||
self.nodes[1].generate(5)
|
||||
self.nodes[1].generatetoaddress(5, node0_mining_addr)
|
||||
self.wait_for_chainlock_tip(self.nodes[1])
|
||||
assert(self.nodes[0].getbestblockhash() == node0_tip)
|
||||
reconnect_isolated_node(self.nodes[0], 1)
|
||||
self.nodes[1].generate(1)
|
||||
self.nodes[1].generatetoaddress(1, node0_mining_addr)
|
||||
self.wait_for_chainlock(self.nodes[0], self.nodes[1].getbestblockhash())
|
||||
|
||||
# Isolate node, mine on both parts of the network, and reconnect
|
||||
isolate_node(self.nodes[0])
|
||||
self.nodes[0].generate(5)
|
||||
self.nodes[1].generate(1)
|
||||
self.nodes[1].generatetoaddress(1, node0_mining_addr)
|
||||
good_tip = self.nodes[1].getbestblockhash()
|
||||
self.wait_for_chainlock_tip(self.nodes[1])
|
||||
assert(not self.nodes[0].getblock(self.nodes[0].getbestblockhash())["chainlock"])
|
||||
reconnect_isolated_node(self.nodes[0], 1)
|
||||
self.nodes[1].generate(1)
|
||||
self.nodes[1].generatetoaddress(1, node0_mining_addr)
|
||||
self.wait_for_chainlock(self.nodes[0], self.nodes[1].getbestblockhash())
|
||||
assert(self.nodes[0].getblock(self.nodes[0].getbestblockhash())["previousblockhash"] == good_tip)
|
||||
assert(self.nodes[1].getblock(self.nodes[1].getbestblockhash())["previousblockhash"] == good_tip)
|
||||
@ -87,7 +88,7 @@ class LLMQChainLocksTest(DashTestFramework):
|
||||
# Now let the node which is on the wrong chain reorg back to the locked chain
|
||||
self.nodes[0].reconsiderblock(good_tip)
|
||||
assert(self.nodes[0].getbestblockhash() != good_tip)
|
||||
self.nodes[1].generate(1)
|
||||
self.nodes[1].generatetoaddress(1, node0_mining_addr)
|
||||
self.wait_for_chainlock(self.nodes[0], self.nodes[1].getbestblockhash())
|
||||
assert(self.nodes[0].getbestblockhash() == self.nodes[1].getbestblockhash())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user