support reserving exact offer amount by splitting output

This commit is contained in:
woodser 2023-06-11 15:28:10 -04:00
parent 0bbb8a4183
commit 722b02f4c9
31 changed files with 424 additions and 173 deletions

View file

@ -95,7 +95,7 @@ class DepositListItem {
}
private void updateUsage(int subaddressIndex, List<MoneroTxWallet> cachedTxs) {
numTxsWithOutputs = XmrWalletService.getTxsWithIncomingOutputs(addressEntry.getSubaddressIndex(), cachedTxs).size();
numTxsWithOutputs = xmrWalletService.getTxsWithIncomingOutputs(addressEntry.getSubaddressIndex(), cachedTxs).size();
usage = subaddressIndex == 0 ? "Base address" : numTxsWithOutputs == 0 ? Res.get("funds.deposit.unused") : Res.get("funds.deposit.usedInTx", numTxsWithOutputs);
}
@ -143,7 +143,7 @@ class DepositListItem {
private MoneroTxWallet getTxWithFewestConfirmations(List<MoneroTxWallet> allIncomingTxs) {
// get txs with incoming outputs to subaddress index
List<MoneroTxWallet> txs = XmrWalletService.getTxsWithIncomingOutputs(addressEntry.getSubaddressIndex(), allIncomingTxs);
List<MoneroTxWallet> txs = xmrWalletService.getTxsWithIncomingOutputs(addressEntry.getSubaddressIndex(), allIncomingTxs);
// get tx with fewest confirmations
MoneroTxWallet highestTx = null;

View file

@ -312,9 +312,7 @@ public class DepositView extends ActivatableView<VBox, Void> {
txsWithIncomingOutputs = xmrWalletService.getTxsWithIncomingOutputs();
// add available address entries and base address
xmrWalletService.getAvailableAddressEntries()
.forEach(e -> observableList.add(new DepositListItem(e, xmrWalletService, formatter, txsWithIncomingOutputs)));
xmrWalletService.getAddressEntries(XmrAddressEntry.Context.BASE_ADDRESS)
xmrWalletService.getAddressEntries()
.forEach(e -> observableList.add(new DepositListItem(e, xmrWalletService, formatter, txsWithIncomingOutputs)));
}