1
0

get_full_history: replace item if it has unique child

(follow-up 7eabbbc81f)

This may happen if we delete a local transaction.
This commit is contained in:
ThomasV
2023-09-20 16:47:09 +02:00
parent d7beb109b8
commit f8c2a38954

View File

@@ -1316,7 +1316,10 @@ class Abstract_Wallet(ABC, Logger, EventListener):
parent['children'].append(tx_item)
now = time.time()
for item in transactions.values():
for key, item in transactions.items():
children = item.get('children', [])
if len(children) == 1:
transactions[key] = children[0]
# add on-chain and lightning values
# note: 'value' has msat precision (as LN has msat precision)
item['value'] = item.get('bc_value', Satoshis(0)) + item.get('ln_value', Satoshis(0))