Exclude change from history

This commit is contained in:
poka 2020-11-27 05:19:28 +01:00
parent c3df37a568
commit 23652b27f8
1 changed files with 18 additions and 16 deletions

View File

@ -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])