Skip to content

Commit

Permalink
Merge pull request #392 from DanGould/select-first-txo-for-now
Browse files Browse the repository at this point in the history
Select first utxo for payjoin contribution
  • Loading branch information
i5hi authored Dec 24, 2024
2 parents 697d3f0 + 0482372 commit f76f14a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/_pkg/payjoin/manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,9 @@ Future<void> _isolateReceiver(List<dynamic> args) async {
sendPort,
);
final unspent = listUnspent as List<bdk.LocalUtxo>;
final candidateInputs = await Future.wait(
unspent.map((utxo) => _inputPairFromUtxo(utxo, true)),
);
final selectedUtxo = await pj5.tryPreservingPrivacy(
candidateInputs: candidateInputs,
);
if (unspent.isEmpty) throw Exception('No unspent outputs available');

final selectedUtxo = await _inputPairFromUtxo(unspent[0], true);
final pj6 = await pj5.contributeInputs(replacementInputs: [selectedUtxo]);
final pj7 = await pj6.commitInputs();

Expand Down

0 comments on commit f76f14a

Please sign in to comment.