Skip to content

Commit

Permalink
update p2p table on user thread to fix null scene
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Dec 29, 2024
1 parent 89007c4 commit c1b17cf
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,14 @@ private boolean isPublicNodesDisabled() {
}

private void updateP2PTable() {
if (connectionService.isShutDownStarted()) return; // ignore if shutting down
p2pPeersTableView.getItems().forEach(P2pNetworkListItem::cleanup);
p2pNetworkListItems.clear();
p2pNetworkListItems.setAll(p2PService.getNetworkNode().getAllConnections().stream()
.map(connection -> new P2pNetworkListItem(connection, clockWatcher))
.collect(Collectors.toList()));
UserThread.execute(() -> {
if (connectionService.isShutDownStarted()) return; // ignore if shutting down
p2pPeersTableView.getItems().forEach(P2pNetworkListItem::cleanup);
p2pNetworkListItems.clear();
p2pNetworkListItems.setAll(p2PService.getNetworkNode().getAllConnections().stream()
.map(connection -> new P2pNetworkListItem(connection, clockWatcher))
.collect(Collectors.toList()));
});
}

private void updateMoneroConnectionsTable() {
Expand Down

0 comments on commit c1b17cf

Please sign in to comment.