Skip to content

Commit

Permalink
feat: clear out custom base node (#6746)
Browse files Browse the repository at this point in the history
Description
---
Cleared out the old custom base node in the console wallet base node
list in the network tab if another one is assigned.

**Note:** Currently in the console wallet we only accept one custom base
node, not a list. The new custom base node was added correctly and the
old one removed from the database, the only issue here was that the
Network tab display was not updated.

Fixes #5353

Motivation and Context
---
The old custom base node was not cleared from the list.

How Has This Been Tested?
---
System-level testing

What process can a PR reviewer use to test or verify this change?
---
Code review

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->

Co-authored-by: SW van Heerden <[email protected]>
  • Loading branch information
hansieodendaal and SWvheerden authored Jan 17, 2025
1 parent 5f4f95b commit 9b35465
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,14 @@ impl AppStateInner {
self.data.base_node_previous = self.data.base_node_selected.clone();
self.data.base_node_selected = peer.clone();
self.data.base_node_peer_custom = Some(peer.clone());
if let Some(pos) = self
.data
.base_node_list
.iter()
.position(|(s, _)| s == "Custom Base Node")
{
self.data.base_node_list.remove(pos);
}
self.data
.base_node_list
.insert(0, ("Custom Base Node".to_string(), peer.clone()));
Expand Down

0 comments on commit 9b35465

Please sign in to comment.