raise exceptions with messages

This commit is contained in:
thomasv 2012-02-06 18:07:01 +01:00
parent fd019addd0
commit d978a8fbcd
1 changed files with 3 additions and 4 deletions

View File

@ -409,9 +409,7 @@ class Wallet:
# check that we get the original signing address
addr = public_key_to_bc_address( '04'.decode('hex') + public_key.to_string() )
# print addr
try:
assert address == addr
except:
if address != addr:
raise BaseException("Bad signature")
@ -772,6 +770,7 @@ class Wallet:
target, signature = line
self.verify_message(previous, signature, "alias:%s:%s"%(alias,target))
assert self.is_valid(target)
if not self.is_valid(target):
raise BaseException("Invalid bitcoin address")
return target, signing_addr, auth_name