Closed sidazhang closed 9 years ago
Dupe Unspents https://github.com/dcousens/bip32-wallet/blob/master/src/wallet.js#L126-L141
I think this is a user input failure, but I'm happy to track the transaction ids and verify they are unique when using setUnspentOutputs
, so I'll add this.
Add unspents
Unspents should be considered a snap shot of the current wallet state only; and should not be mutative (IMHO).
If you're looking for a more scalable way to track unspents, I am too, and I think a separate module that tracks relevant transactions and can provide the unspents atomically would be a better, easier to manage abstraction than lumping it all together in this.
I think this might be better to be an object rather than an array to prevent a client error to adding in duplicate unspents or alternatively someway to aid the client to prevent dupes
Currently, the API only supports setUnspents. So if there is one new unspent, it has to reset it