Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Child Node Handler #3

Open
adrianmross opened this issue Sep 15, 2023 · 1 comment
Open

Duplicate Child Node Handler #3

adrianmross opened this issue Sep 15, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@adrianmross
Copy link
Collaborator

https://github.com/adrianmross/standalone-scp/blob/464219e350e8be047590915242ce1099d86ace6e/parser.cpp#L139-L145

Currently, there is no handler on duplicate children nodes. It should throw an error.

@adrianmross adrianmross added the bug Something isn't working label Sep 15, 2023
@zek224 zek224 self-assigned this Sep 27, 2023
@zek224
Copy link
Collaborator

zek224 commented Sep 27, 2023

Added a unique node string-set in parser.cpp. If the node is found in the set, it doesn't get added to the quorum vector

        // set to track unique nodes in the quorum slice
        set<string> unique_nodes;
        unique_nodes.insert(node_to_name[i]);           // Add the current node to the set

        for(const string& node_name : quorum_names) {
            // check if the node is already in the set
            if(unique_nodes.find(node_name) == unique_nodes.end()) {
                stellar::NodeID curr_node = name_to_node[node_name];
                quorum_vec.push_back(curr_node);
                unique_nodes.insert(node_name); // Add the node to the set
            }
        }
        node_to_quorum[i] = initQSet(quorum_vec);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants