Skip to content

Commit

Permalink
config: include LWK configuration in the output
Browse files Browse the repository at this point in the history
add LWKConfig details to PeerSwapConfig String
 to include LWK configuration in the output.
  • Loading branch information
YusukeShimizu committed May 30, 2024
1 parent 53e56fd commit 83603a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/peerswaplnd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ func (p *PeerSwapConfig) String() string {
if p.LndConfig != nil {
lndString = fmt.Sprintf("host: %s, macaroonpath %s, tlspath %s", p.LndConfig.LndHost, p.LndConfig.MacaroonPath, p.LndConfig.TlsCertPath)
}
var lwkConf string
if p.LWKConfig != nil {
lwkConf = fmt.Sprintf("lwk: signername: %s, walletname: %s, lwkendpoint: %s, electrumendpoint: %s, network: %s, liquidswaps: %v", p.LWKConfig.GetSignerName(), p.LWKConfig.GetWalletName(), p.LWKConfig.GetLWKEndpoint(), p.LWKConfig.GetElectrumEndpoint(), p.LWKConfig.GetNetwork(), p.LWKConfig.GetLiquidSwaps())
}

if p.DataDir != DefaultDatadir && p.PolicyFile == DefaultPolicyFile {
p.PolicyFile = filepath.Join(p.DataDir, "policy.conf")
}

return fmt.Sprintf("Host %s, ConfigFile %s, Datadir %s, Bitcoin enabled: %v, Lnd Config: %s, elements: %s", p.Host, p.ConfigFile, p.DataDir, p.BitcoinEnabled, lndString, liquidString)
return fmt.Sprintf("Host %s, ConfigFile %s, Datadir %s, Bitcoin enabled: %v, Lnd Config: %s, elements: %s, lwk config: %s",
p.Host, p.ConfigFile, p.DataDir, p.BitcoinEnabled, lndString, liquidString, lwkConf)
}

func (p *PeerSwapConfig) Validate() error {
Expand Down

0 comments on commit 83603a2

Please sign in to comment.