diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2023-03-31 02:30:11 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2023-03-31 02:30:11 +0300 |
commit | 7257ae0bf26f85082c5a5a5ed505a55d49c0d2ac (patch) | |
tree | d88185ee32cdd1b9c1547c99bf1028abe5e7d5b7 /api/routes/receiveZChain | |
parent | bc99d5f59de11e712fd47c1f30c31996f50ef5d0 (diff) | |
download | arching-kaos-tools-7257ae0bf26f85082c5a5a5ed505a55d49c0d2ac.tar.gz arching-kaos-tools-7257ae0bf26f85082c5a5a5ed505a55d49c0d2ac.tar.bz2 arching-kaos-tools-7257ae0bf26f85082c5a5a5ed505a55d49c0d2ac.zip |
Fixed ZblockValidator an ZchainValidator
Diffstat (limited to 'api/routes/receiveZChain')
-rw-r--r-- | api/routes/receiveZChain/index.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/api/routes/receiveZChain/index.js b/api/routes/receiveZChain/index.js index 85d1854..6915842 100644 --- a/api/routes/receiveZChain/index.js +++ b/api/routes/receiveZChain/index.js @@ -1,4 +1,24 @@ /* + * After NS validation went through we examine the return code + * of the application that run the test. + * + * Returns: + * - errno on failure + * - on success we process with addNSEntriesToFile() + * + */ +function continuethingsNS(validitycode,sh,res,gotit){ + if (validitycode === 0){ + var entry = { + zchain: sh, + latest: JSON.parse(gotit).Path.replace('/ipfs/','') + }; + addNSEntriesToFile(entry,res); + } else { + res.send({errno:"Invalid data"}); + } +} +/* * Accepts a zchain * * Checks: @@ -12,6 +32,7 @@ * function getNSvalidity() * */ +const getNSvalidity = require('../../validators/ZchainValidator') module.exports = (req, res) => { if ( (req.body.zchain) && req.body.zchain.length === 62 ){//&& req.body.block_signature.length === 46){ |