Now in Protocol 005 we have to pay estimated 1420 mutez for each
tz1 -> tz1 transfer in fees. Also if it's the first transaction from the address we have to add another 1420 mutez for reveal. I used to empty my accounts by sending a transaction with an amount equal to the balance minus 1420 or 2840 mutez.
total_fee = tx_fee + reveal_fee(if needed) amount = balance - total_fee
This calculation formula worked for me fine. But just now I've faced an error says "not enough balance". I see that the difference between needed balance and actual is 1420 mutez. But I've already subtracted 2480 mutez from the balance.
Which kind of operation should I also count in the formula?