From 15c5d31dc73d70cd05a2ce1a83b95be49ff455ab Mon Sep 17 00:00:00 2001 From: moneromooo Date: Sat, 24 Jan 2015 11:33:56 +0000 Subject: [PATCH] payment: GetTipbotAddress now returns None when it fails The display function will turn it into "ERROR" --- tipbot/modules/payment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tipbot/modules/payment.py b/tipbot/modules/payment.py index 0cb816a..3f77943 100644 --- a/tipbot/modules/payment.py +++ b/tipbot/modules/payment.py @@ -25,15 +25,15 @@ def GetTipbotAddress(): j = SendWalletJSONRPCCommand("getaddress",None) if not "result" in j: log_error('GetTipbotAddress: No result found in getaddress reply') - return ERROR + return None result = j["result"] if not "address" in result: log_error('GetTipbotAddress: No address found in getaddress reply') - return ERROR + return None return result["address"] except Exception,e: log_error("GetTipbotAddress: Error retrieving %s's address: %s" % (config.tipbot_name, str(e))) - return "ERROR" + return None def UpdateCoin(data): global last_wallet_update_time @@ -108,7 +108,8 @@ def Deposit(link,cmd): def Help(link): link.send_private("You can send %s to your account:" % coinspecs.name); - link.send_private(" Address: %s" % GetTipbotAddress()) + address=GetTipbotAddress() or 'ERROR' + link.send_private(" Address: %s" % address) link.send_private(" Payment ID: %s" % GetPaymentID(link)) RegisterModule({