bitcoinjs/bitcoinjs-lib — pull request #233 by weilu (2014-06-29 01:45:27+00:00)
Title: wallet: reintroduce output.to to track pending spent utxo

By simply marking an utxo as pending makes it impossible to differentiate incoming and outgoing pending utxos, which leads to erroneous results for `getBalance`. This PR fixes that by attaching the `to` property to a pending spending utxo.

`getUnspentOutputs` excludes such pending spending utxos because from a wallet point view, it should be able to trust spending transactions created by itself, and exclude any pending spent utxo from __unspent__ transaction outputs.