From 5ebf72056069c0b89eb127bde6fcef7e8500f248 Mon Sep 17 00:00:00 2001 From: heke <1280113751@qq.com> Date: Thu, 4 Jan 2024 16:53:26 +0800 Subject: [PATCH] fix get channels --- internal/app/task/ibc_chain_config_task.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/app/task/ibc_chain_config_task.go b/internal/app/task/ibc_chain_config_task.go index 866bde0..b0040f2 100644 --- a/internal/app/task/ibc_chain_config_task.go +++ b/internal/app/task/ibc_chain_config_task.go @@ -107,7 +107,7 @@ func (t *IbcChainConfigTask) getChainConf() ([]*entity.ChainConfig, error) { } // getIbcChannels 通过lcd channels_path 接口获取链上存在的所有channel信息 -func (t *IbcChainConfigTask) getIbcChannels(chain, lcd, apiPath string) ([]*entity.ChannelPath, error) { +func (t *IbcChainConfigTask) getIbcChannels(chain, lcd, originApiPath string) ([]*entity.ChannelPath, error) { if lcd == "" { logrus.Errorf("task %s %s getIbcChannels error, lcd error", t.Name(), chain) return nil, fmt.Errorf("lcd error") @@ -118,7 +118,7 @@ func (t *IbcChainConfigTask) getIbcChannels(chain, lcd, apiPath string) ([]*enti var channelPathList []*entity.ChannelPath for { - apiPath = strings.ReplaceAll(apiPath, replaceHolderOffset, strconv.Itoa(offset)) + apiPath := strings.ReplaceAll(originApiPath, replaceHolderOffset, strconv.Itoa(offset)) apiPath = strings.ReplaceAll(apiPath, replaceHolderLimit, strconv.Itoa(limit)) url := fmt.Sprintf("%s%s", lcd, apiPath) bz, err := utils.HttpGet(url)