Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: break loop when exhausted all transactions #265

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ton/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"context"
"errors"
"fmt"
"strings"
"time"

"github.com/xssnick/tonutils-go/address"
"github.com/xssnick/tonutils-go/tl"
"github.com/xssnick/tonutils-go/tlb"
"github.com/xssnick/tonutils-go/tvm/cell"
"strings"
"time"
)

func init() {
Expand Down Expand Up @@ -224,6 +225,11 @@ func (c *APIClient) SubscribeOnTransactions(workerCtx context.Context, addr *add
case <-time.After(waitList):
}

if lastLT == 0 {
// exhausted all transactins
defi2026-dev marked this conversation as resolved.
Show resolved Hide resolved
break
}

ctx, cancel = context.WithTimeout(workerCtx, 10*time.Second)
res, err := c.ListTransactions(ctx, addr, 10, lastLT, lastHash)
cancel()
Expand Down