aboutsummaryrefslogtreecommitdiff
path: root/api/routes
diff options
context:
space:
mode:
Diffstat (limited to 'api/routes')
-rw-r--r--api/routes/receiveZChain/index.js21
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){