Skip to content

Commit

Permalink
Merge pull request #5483 from BtcContributor/custominput_customfee
Browse files Browse the repository at this point in the history
Fix custom fee rate field when custom inputs are used
  • Loading branch information
ripcurlx authored May 11, 2021
2 parents 993f9b4 + 1a129b3 commit 68f4ec1
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ public void initialize() {
inputsToggleGroupListener = (observable, oldValue, newValue) -> {
useAllInputs.set(newValue == useAllInputsRadioButton);

useCustomFee.setSelected(false);

transactionFeeInputTextField.setEditable(false);
transactionFeeInputTextField.setPromptText(Res.get("funds.withdrawal.useCustomFeeValueInfo"));
transactionFeeInputTextField.setText(String.valueOf(feeService.getTxFeePerVbyte().value));
transactionFeeInputTextField.focusedProperty().addListener(transactionFeeFocusedListener);

feeService.feeUpdateCounterProperty().addListener(transactionFeeChangeListener);
useCustomFee.selectedProperty().addListener(useCustomFeeCheckboxListener);

updateInputSelection();
};

Expand Down Expand Up @@ -613,9 +623,6 @@ private void reset() {
withdrawMemoTextField.setText("");
withdrawMemoTextField.setPromptText(Res.get("funds.withdrawal.memo"));

transactionFeeInputTextField.setText("");
transactionFeeInputTextField.setPromptText(Res.get("funds.withdrawal.useCustomFeeValueInfo"));

selectedItems.clear();
tableView.getSelectionModel().clearSelection();
}
Expand Down Expand Up @@ -733,6 +740,12 @@ public void updateItem(final WithdrawalListItem item, boolean empty) {
inputsToggleGroup.selectedToggleProperty().removeListener(inputsToggleGroupListener);
inputsToggleGroup.selectToggle(useCustomInputsRadioButton);
useAllInputs.set(false);

useCustomFee.setSelected(false);

transactionFeeInputTextField.setEditable(false);
transactionFeeInputTextField.setText(String.valueOf(feeService.getTxFeePerVbyte().value));

inputsToggleGroup.selectedToggleProperty().addListener(inputsToggleGroupListener);
}
});
Expand Down

0 comments on commit 68f4ec1

Please sign in to comment.