add fee parameter to send methods

This commit is contained in:
pokkst 2022-09-13 15:08:46 -05:00
parent de5c096261
commit d37fe29c14
No known key found for this signature in database
GPG key ID: 90C2ED85E67A50FF
3 changed files with 7 additions and 7 deletions

View file

@ -121,7 +121,7 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
}
Toast.makeText(getActivity(), getString(R.string.creating_tx), Toast.LENGTH_SHORT).show();
createButton.setEnabled(false);
createTx(address, amount, sendAll);
createTx(address, amount, sendAll, PendingTransaction.Priority.Priority_Default);
} else if (!validAddress) {
Toast.makeText(getActivity(), getString(R.string.send_address_invalid), Toast.LENGTH_SHORT).show();
} else {
@ -193,9 +193,9 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
});
}
private void createTx(String address, String amount, boolean sendAll) {
private void createTx(String address, String amount, boolean sendAll, PendingTransaction.Priority feePriority) {
AsyncTask.execute(() -> {
PendingTransaction pendingTx = TxService.getInstance().createTx(address, amount, sendAll);
PendingTransaction pendingTx = TxService.getInstance().createTx(address, amount, sendAll, feePriority);
if(pendingTx != null) {
_pendingTransaction.postValue(pendingTx);
} else {

View file

@ -118,9 +118,9 @@ public class MoneroHandlerThread extends Thread implements WalletListener {
listener.onRefresh();
}
public PendingTransaction createTx(String address, String amountStr, boolean sendAll) {
public PendingTransaction createTx(String address, String amountStr, boolean sendAll, PendingTransaction.Priority feePriority) {
long amount = sendAll ? SWEEP_ALL : Wallet.getAmountFromString(amountStr);
return wallet.createTransaction(new TxData(address, amount, 0, PendingTransaction.Priority.Priority_Default));
return wallet.createTransaction(new TxData(address, amount, 0, feePriority));
}
public boolean sendTx(PendingTransaction pendingTx) {

View file

@ -16,8 +16,8 @@ public class TxService extends ServiceBase {
instance = this;
}
public PendingTransaction createTx(String address, String amount, boolean sendAll) {
return this.getThread().createTx(address, amount, sendAll);
public PendingTransaction createTx(String address, String amount, boolean sendAll, PendingTransaction.Priority feePriority) {
return this.getThread().createTx(address, amount, sendAll, feePriority);
}
public boolean sendTx(PendingTransaction pendingTransaction) {