fix npe opening deposit view without monero connection #431
This commit is contained in:
parent
7fc2f5de52
commit
c193385475
@ -162,7 +162,11 @@ class DepositListItem {
|
||||
|
||||
// get tx with fewest confirmations
|
||||
MoneroTxWallet highestTx = null;
|
||||
for (MoneroTxWallet tx : txs) if (highestTx == null || tx.getNumConfirmations() < highestTx.getNumConfirmations()) highestTx = tx;
|
||||
for (MoneroTxWallet tx : txs) {
|
||||
if (highestTx == null || tx.getHeight() == null || (highestTx.getHeight() != null && tx.getHeight() > highestTx.getHeight())) {
|
||||
highestTx = tx;
|
||||
}
|
||||
}
|
||||
return highestTx;
|
||||
}
|
||||
}
|
||||
|
@ -318,12 +318,14 @@ public class DepositView extends ActivatableView<VBox, Void> {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void updateList() {
|
||||
observableList.forEach(DepositListItem::cleanup);
|
||||
observableList.clear();
|
||||
|
||||
// cache incoming txs
|
||||
txsWithIncomingOutputs = xmrWalletService.getTxsWithIncomingOutputs();
|
||||
|
||||
// clear existing items
|
||||
observableList.forEach(DepositListItem::cleanup);
|
||||
observableList.clear();
|
||||
|
||||
// add address entries
|
||||
xmrWalletService.getAddressEntries()
|
||||
.forEach(e -> observableList.add(new DepositListItem(e, xmrWalletService, formatter, txsWithIncomingOutputs)));
|
||||
|
@ -528,7 +528,7 @@ public class GUIUtil {
|
||||
public static void updateConfidence(MoneroTx tx,
|
||||
Tooltip tooltip,
|
||||
TxConfidenceIndicator txConfidenceIndicator) {
|
||||
if (tx != null && !tx.isRelayed()) {
|
||||
if (tx != null && (tx.getNumConfirmations() == null || !tx.isRelayed())) {
|
||||
tooltip.setText(Res.get("confidence.unknown"));
|
||||
txConfidenceIndicator.setProgress(0);
|
||||
} else if (tx != null && tx.isFailed()) {
|
||||
|
Loading…
Reference in New Issue
Block a user