vulpemventures / ocean

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

Add electrum bc scanner #33

Closed altafan closed 1 year ago

altafan commented 1 year ago

This adds a new BlockchainScanner implementation based on electrum service and makes this the default scanner used by ocean when started (unless tweaked of course).

Unexpectedly, this also makes changes to protos and bc scanner interface:

The motivation is that, before this, we had GetBlockHeight defined in bc scanner only because in RestoreWallet we were referencing the birthday block by its hash. Since there's no way in electrum bc scanner to retrieve the height of a block given its hash unless storing all the blocks, the easiest solution is just to reference the birthday block by its height instead of its hash and get rid of GetBlockHeight once and for all. All this, considered also that wallet restoration is a feature under development.

BONUS:

Please @sekulicd review this.