@stellar/halting-analysis
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -36,4 +36,3 @@ "use strict"; | ||
if (node.qset) { | ||
entry.quorumSet.threshold = node.qset.t; | ||
generateQuorumset(node.qset, entry); | ||
generateQuorumset(node.qset, entry, entry.quorumSet); | ||
} | ||
@@ -46,6 +45,12 @@ else if (node.status === "missing") { | ||
} | ||
function generateQuorumset(set, entry) { | ||
function generateQuorumset(set, entry, analysisQuorumSet) { | ||
set.v.forEach(dependent => { | ||
analysisQuorumSet.threshold = set.t; | ||
if (isNested(dependent)) { | ||
generateQuorumset(dependent, entry); | ||
let nestedAnalysisQuorumSet = { | ||
threshold: 0, | ||
dependencies: [] | ||
}; | ||
analysisQuorumSet.dependencies.push(nestedAnalysisQuorumSet); | ||
generateQuorumset(dependent, entry, nestedAnalysisQuorumSet); | ||
} | ||
@@ -59,3 +64,3 @@ else { | ||
const depNode = generateNode(dependentNetworkNode); | ||
entry.quorumSet.dependencies.push(depNode.name); | ||
analysisQuorumSet.dependencies.push(depNode.name); | ||
depNode.dependentsNames.push(entry.name); | ||
@@ -62,0 +67,0 @@ } |
{ | ||
"name": "@stellar/halting-analysis", | ||
"description": "Run halting analysis algorithms on stellar quorums", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "types": "lib/index.d.ts", |
Sorry, the diff of this file is not supported yet
17665
218