Merge pull request #6040 from jmacxx/fix_bsq_sending_issue

Fix issue selecting specific BSQ UTXO for send.
This commit is contained in:
Christoph Atteneder 2022-02-15 21:00:20 +01:00 committed by GitHub
commit 3f978252ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View file

@ -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));
@ -78,8 +78,6 @@ public abstract class BisqDefaultCoinSelector implements CoinSelector {
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);
}

View file

@ -588,7 +588,7 @@ public class BsqWalletService extends WalletService implements DaoStateListener
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());

View file

@ -124,7 +124,7 @@ public class TxInputSelectionWindow extends Overlay<TxInputSelectionWindow> {
.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);