Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue selecting specific BSQ UTXO for send. #6040

Merged
merged 1 commit into from Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public abstract class BisqDefaultCoinSelector implements CoinSelector {
// We reset the value to null just after we have applied it inside the select method.
@Nullable
@Setter
protected Set<TransactionOutput> utxoCandidates;
private Set<TransactionOutput> utxoCandidates;

public CoinSelection select(Coin target, Set<TransactionOutput> candidates) {
return select(target, new ArrayList<>(candidates));
Expand All @@ -78,8 +78,6 @@ public CoinSelection select(Coin target, List<TransactionOutput> candidates) {
ArrayList<TransactionOutput> sortedOutputs;
if (utxoCandidates != null) {
sortedOutputs = new ArrayList<>(utxoCandidates);
// We reuse the selectors. Reset the transactionOutputCandidates field
utxoCandidates = null;
} else {
sortedOutputs = new ArrayList<>(candidates);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ private Transaction getPreparedSendTx(String receiverAddress,
wallet.completeTx(sendRequest);
checkWalletConsistency(wallet);
verifyTransaction(tx);

coinSelector.setUtxoCandidates(null); // We reuse the selectors. Reset the transactionOutputCandidates field
return tx;
} catch (InsufficientMoneyException e) {
log.error("getPreparedSendTx: tx={}", tx.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected void addContent() {
.map(transactionOutput -> new TransactionOutputItem(transactionOutput, candidates.contains(transactionOutput)))
.collect(Collectors.toList()));
tableView.setItems(new SortedList<>(items));
GUIUtil.setFitToRowsForTableView(tableView, 26, 28, 0, items.size());
GUIUtil.setFitToRowsForTableView(tableView, 26, 28, 3, 15);

balanceTextField = FormBuilder.addBalanceTextField(gridPane, rowIndex++, Res.get("inputControlWindow.balanceLabel"), Layout.FIRST_ROW_DISTANCE);
balanceTextField.setFormatter(formatter);
Expand Down