Skip to content

Commit 82229a0

Browse files
Merge pull request #5 from everFinance/develop
fix(): add log
2 parents 5eb89d2 + f8d7bbe commit 82229a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

blocks.go

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func GetBlockIdxs(startHeight int64, arCli *goar.Client) (*BlockIdxs, error) {
2727
// get block hash_list from gateway3
2828
spiltList, err := GetBlockHashListByGateway3(startHeight, endHeight)
2929
if err != nil {
30+
log.Error("GetBlockHashListByGateway3(startHeight, endHeight)", "err", err)
3031
// get block hash_list from trust node
3132
spiltList, err = GetBlockHashList(arCli, startHeight, endHeight)
3233
if err != nil {
@@ -84,6 +85,7 @@ func GetBlockHashList(arCli *goar.Client, startHeight, endHeight int64) ([]strin
8485
}
8586
// todo bug fix
8687
spiltList := list[curHeight-endHeight : curHeight-startHeight+1]
88+
log.Debug("success get block hash_list from arweave gateway", "start", startHeight, "end", endHeight)
8789
return spiltList, nil
8890
}
8991

@@ -127,6 +129,7 @@ func GetBlockHashListFromPeers(c *goar.Client, startHeight, endHeight int64, che
127129
}
128130

129131
if successCount >= checkNum {
132+
log.Debug("success get block hash_list from peers", "start", startHeight, "end", endHeight)
130133
return spiltList, nil
131134
}
132135
if failedCount >= checkNum/2 {
@@ -178,5 +181,6 @@ func GetBlockHashListByGateway3(startHeight, endHeight int64) ([]string, error)
178181
if len(list) != int(endHeight-startHeight+1) {
179182
return nil, errors.New("get list incorrect")
180183
}
184+
log.Debug("success get block hash_list from gateway3.", "start", startHeight, "end", endHeight)
181185
return list, nil
182186
}

0 commit comments

Comments
 (0)