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