Move IsValidAddress to utils

This commit is contained in:
moneromooo 2015-01-11 14:08:12 +00:00
parent 6823e0f926
commit 0dc90676c8
2 changed files with 8 additions and 8 deletions

View file

@ -38,14 +38,6 @@ def CheckDisableWithdraw():
if config.disable_withdraw_on_error:
DisableWithdraw(None,None,None)
def IsValidAddress(address):
if len(address) < coinspecs.address_length[0] or len(address) > coinspecs.address_length[1]:
return False
for prefix in coinspecs.address_prefix:
if address.startswith(prefix):
return True
return False
def Withdraw(nick,chan,cmd):
local_withdraw_fee = config.withdrawal_fee or coinspecs.min_withdrawal_fee
local_min_withdraw_amount = config.min_withdraw_amount or local_withdraw_fee

View file

@ -54,6 +54,14 @@ def GetNickFromPaymentID(p):
log_log('PaymentID %s => %s' % (p, str(nick)))
return nick
def IsValidAddress(address):
if len(address) < coinspecs.address_length[0] or len(address) > coinspecs.address_length[1]:
return False
for prefix in coinspecs.address_prefix:
if address.startswith(prefix):
return True
return False
def AmountToString(amount):
if amount == None:
amount = 0