You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't help but notice that some functions have a lot of nested callbacks. Maybe it would be an idea to abstract the nesting out via an async library like async. This way you could separate the logic more and use optimizations like parallelizing batches of queries to bitcoind.
The text was updated successfully, but these errors were encountered:
I was going to write a really long reply to this a while ago, but the short answer is: I want to use as few dependencies as possible. When people see a bitcoin wallet (especially a brand new one like termcoin), they want to know their coins are safe. The termcoin code is very easy to skim through, and it only has one dependency (blessed, which has 0 dependencies). This kind of discussion will inevitably bring up the whole "trusting trust" thing (that it's impossible to trust any code you did not physically write, etc.), but I think it's probably better to live pragmatically in terms of security, and try to stay secure regardless. So, I'm going to try to keep termcoin as "small" as possible.
As for async itself, it's a great library, but I find it easy enough to write my own async control flow functions (serial and parallel loop functions are, what, maybe 3-4 lines each).
However, you're definitely right about parallelizing stuff like getProgress. I will do that, and should have done it from the beginning. embarrassed
If I really find myself in a rut with regards to async stuff, I'll consider using async. I'll leave this open until I parallelize the functions that need to be.
First off: awesome project!
I couldn't help but notice that some functions have a lot of nested callbacks. Maybe it would be an idea to abstract the nesting out via an async library like async. This way you could separate the logic more and use optimizations like parallelizing batches of queries to bitcoind.
The text was updated successfully, but these errors were encountered: