You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/phantom/main.go
+26-2Lines changed: 26 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ import (
36
36
"log"
37
37
"strconv"
38
38
"sync"
39
+
"os"
39
40
"time"
40
41
41
42
"../../pkg/phantom"
@@ -45,6 +46,7 @@ import (
45
46
"github.com/btcsuite/btcd/chaincfg/chainhash"
46
47
)
47
48
49
+
varminConnectionsuint
48
50
varmaxConnectionsuint
49
51
50
52
varmagicBytesuint32
@@ -63,13 +65,17 @@ var userAgent string
63
65
varcachedPeerserror
64
66
varnumberConnectionsint
65
67
66
-
constVERSION="1.2.7"
68
+
constVERSION="1.2.8"
69
+
70
+
varStartTime time.Time
67
71
68
72
funcmain() {
69
73
70
74
//disable all logging
71
75
//log.SetOutput(ioutil.Discard)
72
76
77
+
StartTime:=time.Now()
78
+
73
79
varmagicHexstring
74
80
varmagicMsgNewLinebool
75
81
varprotocolNumuint
@@ -81,7 +87,8 @@ func main() {
81
87
82
88
flag.StringVar(&coinConfString, "coin_conf", "coinconf.json", "Name of the file to load the coin information from.")
83
89
flag.StringVar(&masternodeConf, "masternode_conf", "masternodeconf.json", "Name of the file to load the masternode information from.")
84
-
flag.UintVar(&maxConnections, "max_connections", 64, "the number of peers to maintain")
90
+
flag.UintVar(&minConnections, "min_connections", 0, "the minimum acceptable number of peers to maintain. If not satified in 5 minutes after app starts, then exit (default = 0 = never exit)")
91
+
flag.UintVar(&maxConnections, "max_connections", 64, "the maximum number of peers to maintain")
85
92
flag.StringVar(&magicHex, "magicbytes", "", "a hex string for the magic bytes")
86
93
flag.UintVar(&defaultPort, "port", 0, "the default port number")
87
94
flag.UintVar(&protocolNum, "protocol_number", 0, "the protocol number to connect and ping with")
0 commit comments