-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple scripthashes' subscription in parallel #600
Conversation
14c9e4e
to
6dfe16d
Compare
With cold cache (using
|
Comparing to 563d8b7 (without parallel subscription): Warm cache:
Cold cache:
|
TL;DR: this PR seems to help on cold cache subscriptions :) |
865f49d
to
539a0b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cool! Couldn't review very deeply but I don't see any issue.
src/electrum.rs
Outdated
scripthashes | ||
.iter() | ||
.map(|scripthash| values.remove(scripthash).unwrap()) | ||
.collect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand the code above correctly it should be possible to do it in a single parallelized pass. I will probably try to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified the code a bit, please take a look :)
_ => None, // exit if any of the calls is not supported | ||
} | ||
}) | ||
.collect::<Option<Vec<ScriptHash>>>()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good first step if wallets send subscriptions like this but would be nice to just process subscriptions separately from non-subscriptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, currently tested with Sparrow :)
Tested locally (with a warm cache) using
netcat 127.0.0.1 50001 < all12_subs.txt
:all12_subs.txt