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:
Drop GetBlockHeight from bc scanner
Add also error to return values of bc scanner's GetUtxos
Refer to birthday block by height in proto's RestoreWallet
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:
fix typos in comments.
rename OCEAN_DATABASE_TYPE to OCEAN_DB_TYPE to be consistent with other env vars naming.
Make bc scanner able to register multiple handlers for the same event
Add utxo locking expiration time to know when it can be unlocked
Fix unlocking of locked utxos at startup by doing that only after unlocking the wallet and after receiving messages from bc scanner.
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:
GetBlockHeight
from bc scannerGetUtxos
The motivation is that, before this, we had
GetBlockHeight
defined in bc scanner only because inRestoreWallet
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 ofGetBlockHeight
once and for all. All this, considered also that wallet restoration is a feature under development.BONUS:
Please @sekulicd review this.