bitcoindevkit / rust-electrum-client

Bitcoin Electrum client library. Supports plaintext, TLS and Onion servers.
MIT License
72 stars 54 forks source link

Retry client should return AlreadySubscribed error #107

Closed RCasatta closed 1 year ago

RCasatta commented 1 year ago

Users may leverage the Error to avoid remembering client-side the subscription status. eg. Always subscribing and calling script_pop in case AlreadySubscribed is returned.

Backport for version 0.14.0

afilini commented 1 year ago

This is technically a breaking change because the same error returned to 0.15 (or 0.14 once we backport) would lead to a different outcome for the user. That said, I consider this more of a bug fix than a simple improvement: it doesn't make sense to keep retrying when we get the "already subscribed" error, it's definitely not a transient error that may get fixed with the next try.

So I think it makes sense to merge this and release as 0.15.1 and then backport and release 0.14.1