Skip to content

Commit

Permalink
Merge pull request #87 from Impa10r/v1.6.9
Browse files Browse the repository at this point in the history
v1.6.9
  • Loading branch information
Impa10r authored Aug 14, 2024
2 parents f36eb8b + f228e1a commit f39bb63
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"program": "${workspaceFolder}/cmd/psweb/",
"showLog": false,
"envFile": "${workspaceFolder}/.env",
//"args": ["-datadir", "/home/vlad/.peerswap2"]
"args": ["-datadir", "/home/vlad/.peerswap_test"]
}
]
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Versions

## 1.6.9

- Fix bitcoinswaps=true persisting in peerswap.conf on psweb restart

## 1.6.8

- AutoFees: do not change inbound fee during pending HTLCs
Expand Down
26 changes: 21 additions & 5 deletions cmd/psweb/config/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,30 @@ func Load(dataDir string) {
} else {
log.Println("Config file created in", Config.DataDir)
}
return
} else {
err = json.Unmarshal(fileData, &Config)
if err != nil {
log.Println("Error unmarshalling config file. Using defaults.")
}
}

err = json.Unmarshal(fileData, &Config)
if err != nil {
log.Println("Error unmarshalling config file. Using defaults.")
}
// on the first start without pswebconfig.json there will be no elements user and password
if Config.ElementsPass == "" || Config.ElementsUser == "" {
// check in peerswap.conf
Config.ElementsPass = GetPeerswapLNDSetting("elementsd.rpcpass")
Config.ElementsUser = GetPeerswapLNDSetting("elementsd.rpcuser")

// check if they were passed as env
if Config.ElementsUser == "" && os.Getenv("ELEMENTS_USER") != "" {
Config.ElementsUser = os.Getenv("ELEMENTS_USER")
}
if Config.ElementsPass == "" && os.Getenv("ELEMENTS_PASS") != "" {
Config.ElementsPass = os.Getenv("ELEMENTS_PASS")
}

// if ElementPass is still empty, this will create temporary peerswap.conf with Liquid disabled
SavePS()
}
}

// saves PS Web config to pswebconfig.json
Expand Down
18 changes: 0 additions & 18 deletions cmd/psweb/config/lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,6 @@ func LoadPS() {
Config.ElementsPort = port
}

// on first start without config there will be no elements user and password
if Config.ElementsPass == "" || Config.ElementsUser == "" {
// check in peerswap.conf
Config.ElementsPass = GetPeerswapLNDSetting("elementsd.rpcpass")
Config.ElementsUser = GetPeerswapLNDSetting("elementsd.rpcuser")

// check if they were passed as env
if Config.ElementsUser == "" && os.Getenv("ELEMENTS_USER") != "" {
Config.ElementsUser = os.Getenv("ELEMENTS_USER")
}
if Config.ElementsPass == "" && os.Getenv("ELEMENTS_PASS") != "" {
Config.ElementsPass = os.Getenv("ELEMENTS_PASS")
}

// if ElementPass is still empty, this will create temporary peerswap.conf with Liquid disabled
SavePS()
}

// find LND path from peerswap.conf
certPath := GetPeerswapLNDSetting("lnd.tlscertpath")

Expand Down
2 changes: 1 addition & 1 deletion cmd/psweb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (

const (
// App version tag
version = "v1.6.8"
version = "v1.6.9"

// Swap Out reserves are hardcoded here:
// https://github.com/ElementsProject/peerswap/blob/c77a82913d7898d0d3b7c83e4a990abf54bd97e5/peerswaprpc/server.go#L105
Expand Down

0 comments on commit f39bb63

Please sign in to comment.