vulpemventures / ocean

:ocean: Elements/Liquid wallet daemon
MIT License
5 stars 7 forks source link

Hotfix: Watch for spent utxos #28

Closed altafan closed 1 year ago

altafan commented 1 year ago

After the intergratation of ocean wallet with other services, we noticed that the wallet didn't get notified by the blockchain scanner for tx with NO new utxos but only SPENT ones.

The reason was that the currently defined blockchain scanner interface allowed only watching for new utxos. This adds a new method WatchForUtxos and adds logic to the account application service in order to start watching utxos as soon as they're added to the underlying repository.

Note that this kind of watch won't be persistent because as soon as a utxo has been spent, we don't need to watch for it anymore.

tiero commented 1 year ago

What happens

Note that this kind of watch won't be persistent

What happens if the process is stopped? we would lose the in-memory wathcer job

altafan commented 1 year ago

What happens if the process is stopped? we would lose the in-memory wathcer job

Nice catch! When the daemon is started we should take care of watching all confirmed utxos. I'll add this logic 👍

altafan commented 1 year ago

@tiero done.