I have a transaction. This transaction was taking a value from AddrX
and sending it to itself in a "split" of sorts. In the transaction there is one VIN
of 98000000
. This transaction split the stack and has two VOUT
. They are both 49000000.5
. There is a transaction fee of 1.00
.
In this case, the total VOUT
is 98000001
which exceeds the total VIN
of 98000000
. However, that difference is found in the transaction fee.
From what I have understood about the blockchain and transactions, the transaction fee is: Fee: sum(vin) - sum(vout)
so it results in a -1
transaction fee.
My issue here is that if I were building a database to track this address I would end up subtracting 98000000
from their balance, and then would add the two incoming values of 49000000.5
which would end up placing their total balance after this transaction to 98000001
which would be incorrect. Now, I could add logic to remove the transaction fee incurred from this manually; however I would have assumed that this transaction would be invalid because the total VOUT
was greater than the total VIN
.
Could this situation be possible? So far from transactions I've seen, the transaction fee has already been applied to one of the VOUT
and thus would not cause this error. If it is possible, how can I detect this and remedy it?