mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2025-01-03 18:48:07 +00:00
add fee parameter to send methods
This commit is contained in:
parent
de5c096261
commit
d37fe29c14
3 changed files with 7 additions and 7 deletions
|
@ -121,7 +121,7 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
}
|
}
|
||||||
Toast.makeText(getActivity(), getString(R.string.creating_tx), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), getString(R.string.creating_tx), Toast.LENGTH_SHORT).show();
|
||||||
createButton.setEnabled(false);
|
createButton.setEnabled(false);
|
||||||
createTx(address, amount, sendAll);
|
createTx(address, amount, sendAll, PendingTransaction.Priority.Priority_Default);
|
||||||
} else if (!validAddress) {
|
} else if (!validAddress) {
|
||||||
Toast.makeText(getActivity(), getString(R.string.send_address_invalid), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), getString(R.string.send_address_invalid), Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} 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(() -> {
|
AsyncTask.execute(() -> {
|
||||||
PendingTransaction pendingTx = TxService.getInstance().createTx(address, amount, sendAll);
|
PendingTransaction pendingTx = TxService.getInstance().createTx(address, amount, sendAll, feePriority);
|
||||||
if(pendingTx != null) {
|
if(pendingTx != null) {
|
||||||
_pendingTransaction.postValue(pendingTx);
|
_pendingTransaction.postValue(pendingTx);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -118,9 +118,9 @@ public class MoneroHandlerThread extends Thread implements WalletListener {
|
||||||
listener.onRefresh();
|
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);
|
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) {
|
public boolean sendTx(PendingTransaction pendingTx) {
|
||||||
|
|
|
@ -16,8 +16,8 @@ public class TxService extends ServiceBase {
|
||||||
instance = this;
|
instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PendingTransaction createTx(String address, String amount, boolean sendAll) {
|
public PendingTransaction createTx(String address, String amount, boolean sendAll, PendingTransaction.Priority feePriority) {
|
||||||
return this.getThread().createTx(address, amount, sendAll);
|
return this.getThread().createTx(address, amount, sendAll, feePriority);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sendTx(PendingTransaction pendingTransaction) {
|
public boolean sendTx(PendingTransaction pendingTransaction) {
|
||||||
|
|
Loading…
Reference in a new issue