Error "Attempt to transfer unavailable funds"

119 views Asked by At

I have a problem with "quick" assets transferring through several accounts. For example, I have 3 accounts: A, B(no assets), C. I transfer some amount of asset from A to B account, then look for "A->B" transaction (/transactions/info/{id}). If the transaction was found I transfer the same amount from B to C account. In most cases everything is fine, but sometimes I get an error:

StateCheckFailedException: State check failed. Reason: Attempt to transfer unavailable funds: Transaction application leads to negative asset 'IssuedAsset(...)' balance to (at least) temporary negative state, the current balance is 0 ...

If I will wait for 10 seconds, for example, "B->C" transfer will be succeeded. So, it seems that I should wait for some synchronization of the account's balances in the node.

Is there any guaranteed way in my case to make "B->C" transfer without waiting for an undetermined time? "A->B" transaction's presence in a blockchain doesn't work sometimes.

I use my own node for the broadcasting transactions. Node's configuration is the default. Version 1.1.7

1

There are 1 answers

0
TurtleNetwork On

This is due the fact from microblocks. Microblocks did transfer the funds, but didn't confirmed them yet permanently and therefore aren't yet fully in the blockchain. If you want to be fully sure, I would say, wait 1 block (or 60 seconds). But even then it might not always be confirmed, since even waveschain has some moments it's being overloaded with thousands of tx's for a few minutes.

It's the same with other actions like creating assets etc.