mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 20:56:45 +00:00
set send amount to total utxo value when sending selected utxos before an address or label is added
This commit is contained in:
parent
94088f795c
commit
dd146210ba
2 changed files with 6 additions and 1 deletions
|
@ -278,7 +278,9 @@ public class PaymentController extends WalletFormController implements Initializ
|
||||||
|
|
||||||
public void setPayment(Payment payment) {
|
public void setPayment(Payment payment) {
|
||||||
if(getRecipientValueSats() == null || payment.getAmount() != getRecipientValueSats()) {
|
if(getRecipientValueSats() == null || payment.getAmount() != getRecipientValueSats()) {
|
||||||
|
if(payment.getAddress() != null) {
|
||||||
address.setText(payment.getAddress().toString());
|
address.setText(payment.getAddress().toString());
|
||||||
|
}
|
||||||
if(payment.getLabel() != null && !label.getText().equals(payment.getLabel())) {
|
if(payment.getLabel() != null && !label.getText().equals(payment.getLabel())) {
|
||||||
label.setText(payment.getLabel());
|
label.setText(payment.getLabel());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1063,6 +1063,9 @@ public class SendController extends WalletFormController implements Initializabl
|
||||||
if(event.getPayments() != null) {
|
if(event.getPayments() != null) {
|
||||||
clear(null);
|
clear(null);
|
||||||
setPayments(event.getPayments());
|
setPayments(event.getPayments());
|
||||||
|
} else if(paymentTabs.getTabs().size() == 1) {
|
||||||
|
Payment payment = new Payment(null, null, event.getUtxos().stream().mapToLong(BlockTransactionHashIndex::getValue).sum(), true);
|
||||||
|
setPayments(List.of(payment));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(event.getFee() != null) {
|
if(event.getFee() != null) {
|
||||||
|
|
Loading…
Reference in a new issue