From fee1f91a3137ef1056e15cc606a186b0e508f84c Mon Sep 17 00:00:00 2001 From: goatpig Date: Sat, 31 Mar 2018 22:43:01 +0200 Subject: [PATCH] fix new tx systray notification --- ArmoryQt.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ArmoryQt.py b/ArmoryQt.py index d1a6998ea..9efab20de 100755 --- a/ArmoryQt.py +++ b/ArmoryQt.py @@ -5345,22 +5345,19 @@ def doTheSystemTrayThing(self): # If coins were either received or sent from the loaded wlt/lbox dispLines = QStringList() totalStr = coin2strNZS(abs(le.getValue())) + title = None if le.getValue() > 0: title = self.tr('Bitcoins Received!') dispLines.append(self.tr('Amount: %1 BTC').arg(totalStr)) dispLines.append(self.tr('From: %2').arg(wltName)) elif le.getValue() < 0: try: - # Also display the address of where they went - txref = TheBDM.bdv().getTxByHash(le.getTxHash()) - nOut = txref.getNumTxOut() recipStr = '' - for i in range(0, nOut): - script = txref.getTxOutCopy(i).getScript() - if pywlt.hasScrAddr(script_to_scrAddr(script)): + for addr in le.getScrAddrList(): + if pywlt.hasScrAddr(addr): continue if len(recipStr)==0: - recipStr = self.getDisplayStringForScript(script, 45)['String'] + recipStr = hash160_to_addrStr(addr[1:], addr[0]) else: recipStr = self.tr('') @@ -5371,9 +5368,10 @@ def doTheSystemTrayThing(self): except Exception as e: LOGERROR('tx broadcast systray display failed with error: %s' % e) - self.showTrayMsg(title, dispLines.join("\n"), \ - QSystemTrayIcon.Information, 10000) - LOGINFO(title + '\n' + dispLines.join("\n")) + if title: + self.showTrayMsg(title, dispLines.join("\n"), \ + QSystemTrayIcon.Information, 10000) + LOGINFO(title + '\n' + dispLines.join("\n")) # Wait for 5 seconds before processing the next queue object. self.notifyBlockedUntil = RightNow() + 5