Browse Source

prox

master
zeus 4 years ago
parent
commit
3fbd4aef73
  1. 15
      swarmlab-app/src/run/app.js

15
swarmlab-app/src/run/app.js

@ -431,20 +431,23 @@ function getSHA256ofJSON(input){
return require("crypto").createHash("sha256").update(JSON.stringify(input)).digest("hex"); return require("crypto").createHash("sha256").update(JSON.stringify(input)).digest("hex");
} }
var getkey = function getkey(key) { //var getkey = function getkey(key) {
return new Promise((resolve) => { async function getkey(key) {
//return new Promise((resolve) => {
pubClient.get(key, function (err, reply) { await pubClient.get(key, function (err, reply) {
if(err){ if(err){
console.log('----------not fount------------') console.log('----------not fount------------')
resolve(null) //resolve(null)
return null
} }
else { else {
console.log('---------fount----------') console.log('---------fount----------')
resolve(reply) //resolve(reply)
return reply
} }
}) })
}) //})
} }
var setkey = function setkv(key,value){ var setkey = function setkv(key,value){

Loading…
Cancel
Save