Description
When using electrum as indexer, the service logs the following warning repeatedly:
your wallet uses less efficient method of querying electrs, consider contacting the developer of your wallet. Reason: blockchain.scripthash.get_history called for unsubscribed scripthash
To address this we should use the subscription feature and get histories only for scripts with updates.
To implement this we could store a map (in memory) and call script_subscribe
/script_pop
to update it. Then we should call script_get_history
only if the hash returned by these 2 calls has changed from the last time we synced the wallet. Since script_subscribe
should be called only once I think the cleaner way to address this is by implementing the Indexer::update
method (which currently is unimplemented). This way the Indexer::create
method should just call script_subscribe
(and script_get_history
) for all addresses once, while subsequent wallet syncs would go through Indexer::update
and call script_pop
(and call script_get_history
only where necessary).
Otherwise, if there are no plans in the near future to implement Indexer::update
we can implement the logic to check if we already subscribed to a script directly in the Indexer::create
.
@dr-orlovsky please let me know what do you think, I can work on this if you prefer
Metadata
Metadata
Assignees
Labels
Type
Projects
Status