add timestamp to history command output, convert value to float

This commit is contained in:
ThomasV 2015-08-19 11:04:06 +02:00
parent ed6c6bae24
commit 6bbfef5198
1 changed files with 9 additions and 4 deletions

View File

@ -453,13 +453,18 @@ class Commands:
for item in self.wallet.get_history():
tx_hash, conf, value, timestamp, balance = item
try:
time_str = datetime.datetime.fromtimestamp( timestamp).isoformat(' ')[:-3]
time_str = datetime.datetime.fromtimestamp(timestamp).isoformat(' ')[:-3]
except Exception:
time_str = "----"
label, is_default_label = self.wallet.get_label(tx_hash)
out.append({'txid':tx_hash, 'date':"%16s"%time_str, 'label':label, 'value':format_satoshis(value), 'confirmations':conf})
out.append({
'txid':tx_hash,
'timestamp':timestamp,
'date':"%16s"%time_str,
'label':label,
'value':float(format_satoshis(value)) if value is not None else None,
'confirmations':conf}
)
return out
@command('w')