(utxoset, channel_id)
| 226 | |
| 227 | |
| 228 | def utxos_for_channel(utxoset, channel_id): |
| 229 | relevant_txids = [] |
| 230 | chan_utxos = {} |
| 231 | |
| 232 | def _add_relevant(txid, utxo): |
| 233 | if txid not in chan_utxos: |
| 234 | chan_utxos[txid] = [] |
| 235 | chan_utxos[txid].append(utxo) |
| 236 | |
| 237 | for txid, utxo_list in utxoset.items(): |
| 238 | for utxo in utxo_list: |
| 239 | if utxo[0]['account_id'] == channel_id: |
| 240 | _add_relevant(txid, utxo) |
| 241 | relevant_txids.append(txid) |
| 242 | if utxo[1]: |
| 243 | relevant_txids.append(utxo[1]['spending_txid']) |
| 244 | elif txid in relevant_txids: |
| 245 | _add_relevant(txid, utxo) |
| 246 | if utxo[1]: |
| 247 | relevant_txids.append(utxo[1]['spending_txid']) |
| 248 | |
| 249 | # if they're not well ordered, we'll leave some txids out |
| 250 | for txid in relevant_txids: |
| 251 | if txid not in chan_utxos: |
| 252 | chan_utxos[txid] = utxoset[txid] |
| 253 | |
| 254 | return chan_utxos |
| 255 | |
| 256 | |
| 257 | def matchup_events(u_set, evs, chans, tag_list): |
no test coverage detected