findOurOwnCoins function
Implementation
List<ElectrumOutput> findOurOwnCoins(
List<ElectrumOutput> outputs,
Iterable<NodeWithAddress> nodes,
Iterable<AddressType> addressTypes,
UTXONetworkType type,
) {
final outputs0 = <ElectrumOutput>[];
for (final vout in outputs) {
final outputAddresses = vout.getAddresses(
networkType: type,
addressTypes: addressTypes,
);
final node = nodes.singleWhereOrNull(
(node) => node.addressesList.any(
(nodeAddress) => outputAddresses.contains(nodeAddress),
),
);
final belongsToUs = node != null;
outputs0.add(
vout.copyWith(
belongsToUs: belongsToUs,
node: node,
),
);
}
return outputs0;
}