1d498eeefc
It does not make sense to count change outputs in our unconfirmed balance, because our balance will not be negatively affected if the transaction does not get confirmed. It is also incorrect to add signed values of get_addr_balance in order to compute the balance over a domain. For example, this leads to incoming and outgoing transactions cancelling out in our total unconfirmed balance. This commit looks at the coins that are spent by a transaction. If those coins belong to us and are confirmed, we do not count the transaction outputs in our unconfirmed balance. As a result, get_balance always returns positive values for unconfirmed balance.