Only generate xPOP with validations from UNL{

This commit is contained in:
Wietse Wind
2023-10-30 16:24:06 +01:00
parent 9c4878f66f
commit 6d5064fea3

View File

@@ -51,7 +51,7 @@ const xpopGenerate = async ({
vl, vl,
json, json,
binary, binary,
validations, _allValidations,
tx tx
] = await Promise.all([ ] = await Promise.all([
catjson(relativeStorDir + '/vl.json'), catjson(relativeStorDir + '/vl.json'),
@@ -61,6 +61,9 @@ const xpopGenerate = async ({
catjson(relativeStorDir + '/tx_' + txHash + '.json'), catjson(relativeStorDir + '/tx_' + txHash + '.json'),
]) ])
const unlValidators = Object.keys(vl?.unl || {})
const validations = _allValidations.filter(v => unlValidators.indexOf(v.validation_public_key) > -1)
const xpopJson = await xpop({ vl, ledger: { json, binary, }, validations, tx, }) const xpopJson = await xpop({ vl, ledger: { json, binary, }, validations, tx, })
const xpopFilename = 'xpop_' + txHash + '.json' const xpopFilename = 'xpop_' + txHash + '.json'