From 0dc90676c8d36f9a9e5f26dcbff0cfde85cac285 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Sun, 11 Jan 2015 14:08:12 +0000 Subject: [PATCH] Move IsValidAddress to utils --- tipbot/modules/withdraw.py | 8 -------- tipbot/utils.py | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tipbot/modules/withdraw.py b/tipbot/modules/withdraw.py index f85f4ae..051cc6d 100644 --- a/tipbot/modules/withdraw.py +++ b/tipbot/modules/withdraw.py @@ -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 diff --git a/tipbot/utils.py b/tipbot/utils.py index e76799f..7484093 100644 --- a/tipbot/utils.py +++ b/tipbot/utils.py @@ -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