Skip to content

Commit 347150c

Browse files
committed
Disable Peer GUI launch button when not using a local network
1 parent 3a2d898 commit 347150c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

convex-gui/src/main/java/convex/gui/peer/ServerListPanel.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import convex.core.Coin;
2121
import convex.core.crypto.AKeyPair;
2222
import convex.core.exceptions.TODOException;
23+
import convex.core.init.Init;
2324
import convex.core.util.Utils;
2425
import convex.gui.components.ActionButton;
2526
import convex.gui.components.ActionPanel;
@@ -70,7 +71,11 @@ public ServerListPanel(PeerGUI manager) {
7071
ConvexLocal convex=manager.getDefaultConvex();
7172
manager.launchExtraPeer(convex);
7273
});
73-
btnLaunch.setToolTipText("Launch an extra peer for the network. Allocates some stake from genesis account");
74+
btnLaunch.setToolTipText("Launch an extra peer when running a local network. Allocates some stake from genesis peer controller account.");
75+
if (!Init.GENESIS_PEER_ADDRESS.equals (manager.getDefaultConvex().getAddress())) {
76+
// Disable if we are not the genesis peer
77+
btnLaunch.setEnabled(false);
78+
}
7479
toolBar.add(btnLaunch);
7580

7681
// TODO: We probably want to restore this, but semantics not obvious

0 commit comments

Comments
 (0)