MCPcopy Create free account
hub / github.com/ElementsProject/lightning / extract_utxos

Function extract_utxos

tests/utils.py:187–206  ·  view source on GitHub ↗
(moves)

Source from the content-addressed store, hash-verified

185
186
187def extract_utxos(moves):
188 utxos = {}
189 for m in moves:
190 if 'utxo_txid' not in m:
191 continue
192 txid = m['utxo_txid']
193 if txid not in utxos:
194 utxos[txid] = []
195
196 if 'txid' not in m:
197 utxos[txid].append([m, None])
198 else:
199 evs = utxos[txid]
200 # it's a withdrawal, find the deposit and add to the pair
201 for ev in evs:
202 if ev[0]['vout'] == m['vout']:
203 ev[1] = m
204 assert ev[0]['output_msat'] == m['output_msat']
205 break
206 return utxos
207
208
209def print_utxos(utxos):

Callers 1

check_utxos_channelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected