tonutils-go icon indicating copy to clipboard operation
tonutils-go copied to clipboard

transaction was not confirmed in a given deadline, but it may still be confirmed later

Open iw4p opened this issue 10 months ago • 4 comments

Hi! Hope you are doing well. I have a big problem with

transaction was not confirmed in a given deadline, but it may still be confirmed later

Do you think increasing the scanning number from 5 to maybe 10 can fix this problem? I am sending transactions with a normal sleep time like 15s or sometimes 20s. But still sometimes I get this error. It's really make the system unreliable because sometimes it does not send the transactions, and sometimes it sends.

https://github.com/xssnick/tonutils-go/blob/642950da31f12a34c998a5a5803b522ec1dd2f2c/ton/sendmessagewait.go#L78

Do you have any idea?

iw4p avatar Jan 17 '25 10:01 iw4p

Hi, externals may lost during broadcasting between liteserver and nodes sometimes, increasing limit will not help i think, you better to wait for timeout and message timeout (specified in wallet) and retry in this case.

xssnick avatar Jan 20 '25 18:01 xssnick

The problem is I got "transaction was not confirmed in a given deadline, but it may still be confirmed later", for both successful transactions and failed transaction and I have no idea how I can fix it. I set more than 20s sleep between each transaction but still I got this error. Sometimes too much.

iw4p avatar Jan 20 '25 20:01 iw4p

the only way that I found to solve that was something like: _, _, err = sender.SendWaitTransaction(ctx, &wallet.Message{ Mode: wallet.PayGasSeparately, InternalMessage: &tlb.InternalMessage{ Bounce: false, DstAddr: address.MustParseAddr(recAddr), Amount: tlb.MustFromTON(amountStr), }, }) if err != nil { if strings.Contains(err.Error(), "transaction was not confirmed") { // start a gorutine that checks if the tx is success. } you can use the method listTransactions and check the time and the last txs in the receiver, I know that is not the best way but you can resend the transaction if you dont find it after 1 hour.

Kevinbarrero avatar Jan 24 '25 14:01 Kevinbarrero

Won't work for me as I send transactions the to same address (imagine DstAddr is always XYZ), so there's no unique factor that I can check that the specific transaction to XYZ address is received or not.

iw4p avatar Jan 24 '25 14:01 iw4p

Won't work for me as I send transactions the to same address (imagine DstAddr is always XYZ), so there's no unique factor that I can check that the specific transaction to XYZ address is received or not.

Can you use unique comment for each transaction so you can use it as a unique factor?

lavrd avatar Mar 26 '25 08:03 lavrd

Won't work for me as I send transactions the to same address (imagine DstAddr is always XYZ), so there's no unique factor that I can check that the specific transaction to XYZ address is received or not.

Can you use unique comment for each transaction so you can use it as a unique factor?

Not in my case, putting a good number for sleep between each transaction can make sure the previous transaction's broadcasted successfully.

iw4p avatar Mar 26 '25 08:03 iw4p