Skip to content

Commit e75cd7b

Browse files
author
Maran
committed
Support compressed keys
1 parent fbe545c commit e75cd7b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/mastercoin-wallet/gui/first_run_window.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,15 @@ def on_private_key_input_textChanged(text)
8282
@address = Bitcoin::Key.from_base58(@priv_key).addr
8383
@address_label.setText("Address for private key: #{@address}")
8484
check_valid
85-
rescue RuntimeError
86-
@address = nil
87-
@address_label.setText("Cannot get Bitcoin address from private key.")
88-
invalid!
85+
rescue ArgumentError, RuntimeError, OpenSSL::BNError
86+
begin
87+
@address = Bitcoin::Key.new(@priv_key).addr
88+
@address_label.setText("Address for private key: #{@address}")
89+
check_valid
90+
rescue RuntimeError, OpenSSL::BNError
91+
@address_label.setText("Cannot get Bitcoin address from private key.")
92+
invalid!
93+
end
8994
end
9095
end
9196
end

0 commit comments

Comments
 (0)