neodix42/ton4j

waitForBalanceChange <bug>

Closed this issue · 2 comments

Here's a bug encountered with waitForBalanceChange:

After a successful transfer, if BigInteger initialBalance = getBalance(); retrieves the balance after the transfer, it will cause an issue where the process keeps waiting indefinitely.

This happens because the initial balance is set to the post-transfer amount, making the system think no change has occurred.

source code:
截屏2024-09-20 10 03 11

waitForBalanceChange() should be called right after TX has been sent, in that way balance is not updated yet. Obviously if you call it with a delay you might get the status with the updated balance.

Thanks!