diff --git a/lib/historylib.py b/lib/historylib.py index b67a1ea..f34723c 100644 --- a/lib/historylib.py +++ b/lib/historylib.py @@ -81,22 +81,24 @@ class History: res = self.historyDoc['transactionsHistory'][sens] for bloc in res: output = bloc['outputs'][0] - trans.append(i) - trans[i] = [] - trans[i].append(sens) - if sens in ('receiving','sending'): - trans[i].append(int(time.time())) - else: - trans[i].append(bloc['writtenTime']) - if sens in ('sent','sending'): - trans[i].append(output.split("SIG(")[1].replace(')','')) - else: - trans[i].append(bloc['issuers'][0]) - amount = int(output.split(':')[0]) - base = int(output.split(':')[1]) - trans[i].append(amount*pow(10,base)/100) - trans[i].append(bloc['comment']) - i += 1 + outPubkey = output.split("SIG(")[1].replace(')','') + if sens in ('received','receiving') or self.pubkey != outPubkey: + trans.append(i) + trans[i] = [] + trans[i].append(sens) + if sens in ('receiving','sending'): + trans[i].append(int(time.time())) + else: + trans[i].append(bloc['writtenTime']) + if sens in ('sent','sending'): + trans[i].append(outPubkey) + else: + trans[i].append(bloc['issuers'][0]) + amount = int(output.split(':')[0]) + base = int(output.split(':')[1]) + trans[i].append(amount*pow(10,base)/100) + trans[i].append(bloc['comment']) + i += 1 trans.sort(key=lambda x: x[1])