xssnick / tonutils-go

TON SDK Library in pure Golang for interacting with The Open Network ecosystem using native protocols, such as ADNL, RLDP and etc.
Apache License 2.0
535 stars 109 forks source link

fix: break loop when exhausted all transactions #265

Open defi2026-dev opened 1 month ago

xssnick commented 4 weeks ago

Hi, this method is intended to work without break, since it is subscription. You can stop it by context cancellation when you want

defi2026-dev commented 2 weeks ago

Hi, this method is intended to work without break, since it is subscription. You can stop it by context cancellation when you want

it's to break the inner loop, otherwise, it'll keep passing lastLT = 0 to ListTransactions, and it never return a empty list to break the inner loop, that's what I see in my test case.

defi2026-dev commented 2 weeks ago

I just re-checked the case, ListTransactions(lastLT=0) will return a non-nil error, then we'll retry in the inner loop, that's why it never breaks the inner loop.