@@ -48,6 +48,7 @@ type Configuration struct {
4848 AutoSwapMaxAmount uint64
4949 AutoSwapThresholdPPM uint64
5050 AutoSwapTargetPct uint64
51+ AutoSwapPremiumLimit int64
5152 SecureConnection bool
5253 ServerIPs string
5354 SecurePort string
@@ -78,7 +79,7 @@ func Load(dataDir string, network string) {
7879 Config .ElementsHost = "http://127.0.0.1"
7980 Config .ElementsPort = "18884"
8081
81- Config .Chain = "mainnet"
82+ Config .Chain = network
8283 Config .NodeApi = "https://amboss.space/node"
8384 Config .BitcoinApi = "https://mempool.space"
8485 Config .LiquidApi = "https://liquid.network"
@@ -89,10 +90,9 @@ func Load(dataDir string, network string) {
8990 Config .SecureConnection = false
9091 Config .SecurePort = "1985"
9192
92- if network == "testnet" {
93- Config .Chain = "testnet"
94- Config .NodeApi = "https://mempool.space/testnet/lightning/node"
95- Config .BitcoinApi = "https://mempool.space/testnet"
93+ if network != "mainnet" {
94+ Config .NodeApi = "https://mempool.space/" + network + "/lightning/node"
95+ Config .BitcoinApi = "https://mempool.space/" + network
9696 Config .LiquidApi = "https://liquid.network/testnet"
9797 Config .ElementsPort = "7039"
9898 }
@@ -115,7 +115,7 @@ func Load(dataDir string, network string) {
115115 }
116116
117117 // different defaults for LND and CLN
118- loadDefaults (currentUser .HomeDir , dataDir )
118+ loadDefaults (currentUser .HomeDir , dataDir , network )
119119
120120 // load config from peerswap.conf
121121 LoadPS ()
@@ -176,10 +176,10 @@ func Save() error {
176176
177177// fallback for Bitcoin Core API if local is unreachable
178178func GetBlockIoHost () string {
179- if Config .Chain == "testnet " {
180- return "https://go.getblock.io/77cfc97c83e0454fb35557331188e7d6 "
179+ if Config .Chain == "mainnet " {
180+ return "https://go.getblock.io/6f4b1867b4324698936d8d18ea99a245 "
181181 } else {
182- return "https://go.getblock.io/62af44fe83f540539ed0a1b52a80d41e "
182+ return "https://go.getblock.io/6bf5fea3b5344c43a061fd295f613be4 "
183183 }
184184}
185185
@@ -188,6 +188,7 @@ func GetHostname() string {
188188 // Get the hostname of the machine
189189 hostname , _ := os .Hostname ()
190190
191+ // Env takes priority
191192 if os .Getenv ("HOSTNAME" ) != "" {
192193 hostname = os .Getenv ("HOSTNAME" )
193194 }
0 commit comments