-
Notifications
You must be signed in to change notification settings - Fork 243
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
Improved export and restore hot wallet process #1353
Improved export and restore hot wallet process #1353
Conversation
d954d37
to
89c65d6
Compare
@@ -117,6 +117,7 @@ def general(): | |||
continue | |||
write_wallet(wallet) | |||
app.specter.wallet_manager.update() | |||
time.sleep(1) |
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.
Why is that needed?
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.
During restoration process, after selecting the files I was getting the error that the wallets linked with the hot wallet were not restored because they do not exist. So after seeing logs I concluded that before wallet manager could update all the wallets, following line was being executed and giving the error. So to avoid that this sleep is needed.
wallet_obj = app.specter.wallet_manager.get_by_alias(wallet["alias"])
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.
I think a better approach here would be to not use the threading in wallet_manager.update()
you could add to that update funtion a parameter like threading=True
, then in line 105 of the wallet_manager do:
if self.allow_threading and threading:
Or something like that...
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.
Updated in latest commit
@@ -62,7 +62,7 @@ | |||
{% endif %} | |||
{% if device.hot_wallet %} | |||
<button id="{{ device.alias }}_hot_sign_btn" class="btn flex-item" style="width: 190px; margin: 15px auto;"> | |||
{% if device.device_type == "bitcoincore" %} | |||
{% if device.device_type == "bitcoincore" or device.device_type == "bitcoincore_watchonly" %} |
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.
Hmm this probably should be treated differently as a watch only can't sign
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.
right, maybe i think we should not render the button for signing the transaction in this case.
name = "Bitcoin Core (watch only)" | ||
icon = "bitcoincore_icon.svg" | ||
|
||
hot_wallet = True |
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.
Unnecessary since it inherits BitcoinCore which has it already
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.
Removed in latest commit
Added bitcoincore_watchonly device type and now while exporting bitcoincore hot wallets, they will exported as watchonly wallets.
f3827df
to
3dfe1f1
Compare
bitcoincore_watchonly class
Can we have a bit more verbose documentation on this feature? Comments in the code are very rare. Maybe you can do one or more of these things:
|
Closing this in favor of #1495 where i can commit. |
Fixes #948
Added bitcoincore_watchonly device type and now while exporting
bitcoincore hot wallets, they will exported as watchonly wallets.