Commit 507e90ce authored by Son of Odin's avatar Son of Odin

PR Feedback

parent e091b690
Pipeline #130203549 passed with stages
in 31 minutes and 52 seconds
......@@ -105,7 +105,7 @@ func (b *ThorchainBlockScan) processTxOutBlock(blockHeight int64) error {
}
tx, err := b.thorchain.GetKeysign(blockHeight, pk.String())
if err != nil {
if err.Error() == "not found" {
if errors.Is(err, thorclient.ErrNotFound) {
// custom error (to be dropped and not logged) because the block is
// available yet
return errors.New("")
......
......@@ -11,6 +11,8 @@ import (
"gitlab.com/thorchain/thornode/bifrost/thorclient/types"
)
var ErrNotFound error = fmt.Errorf("not found")
// GetKeysign retrieves txout from this block height from thorchain
func (b *ThorchainBridge) GetKeysign(blockHeight int64, pk string) (types.ChainsTxOut, error) {
url := fmt.Sprintf("%s/%d/%s", KeysignEndpoint, blockHeight, pk)
......@@ -18,7 +20,7 @@ func (b *ThorchainBridge) GetKeysign(blockHeight int64, pk string) (types.Chains
if err != nil {
b.errCounter.WithLabelValues("fail_get_tx_out", strconv.FormatInt(blockHeight, 10)).Inc()
if status == http.StatusNotFound {
return types.ChainsTxOut{}, fmt.Errorf("not found")
return types.ChainsTxOut{}, ErrNotFound
}
return types.ChainsTxOut{}, errors.Wrap(err, "failed to get tx from a block height")
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment