Skip to content

Commit

Permalink
Merge pull request #143 from LNOpenMetrics/macros/update_cache
Browse files Browse the repository at this point in the history
fix: fix json - struct mapping
  • Loading branch information
vincenzopalazzo committed Jun 12, 2023
2 parents b0c28e6 + 33402cf commit 5ad4c0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion internal/metrics/metrics_one.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,9 @@ func (instance *RawLocalScore) collectInfoChannel(lightning cln4go.Client,

infoMap, err := instance.getChannelInfo(lightning, channel, infoChannel)
if err != nil {
log.GetInstance().Error(fmt.Sprintf("Error during get the information about the channel: %s", err))
log.GetInstance().Errorf("Error during get the information about the channel: %s", err)
str, _ := instance.Encoder.EncodeToString(channel)
log.GetInstance().Errorf("channel under analysis: `%s`", *str)
return err
}

Expand Down
10 changes: 7 additions & 3 deletions pkg/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ func ParseDeprecatedMsat(msat any) uint64 {
if msat != nil {
switch val := msat.(type) {
case string:
res, _ := ParseMsatStrToInt(&val)
res, err := ParseMsatStrToInt(&val)
if err != nil {
log.GetInstance().Errorf("parsing msat string fails with error %s", err)
log.GetInstance().Errorf("original value is %s", val)
}
return res
default:
res, _ := val.(float64)
Expand Down Expand Up @@ -106,8 +110,8 @@ type ListChannelsChannel struct {
LastUpdate uint64 `json:"last_update"`
BaseFeeMillisatoshi uint64 `json:"base_fee_millisatoshi"`
FeePerMillionth uint64 `json:"fee_per_millionth"`
HtlcMinimumMsat uint64 `json:"minimum_htlc_out_msat"`
HtlcMaximumMsat uint64 `json:"maximum_htlc_out_msat"`
HtlcMinimumMsat uint64 `json:"minimum_htlc_msat"`
HtlcMaximumMsat uint64 `json:"maximum_htlc_msat"`
}

func (self *ListChannelsChannel) HtlcMinMsat() *string {
Expand Down

0 comments on commit 5ad4c0f

Please sign in to comment.