Commit f44ce2f6 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Fix: could not dynamically change secret key

parent 6e001363
......@@ -7,9 +7,8 @@ var constants = require('./constants');
var dos2unix = require('./dos2unix');
var signature = require('./signature');
var rawer = require('./rawer');
var logger = require('./logger')();
var signatureFunc;
var signatureFunc, lastSecret;
let speed = 1;
let A_SECOND = 1000;
......@@ -30,10 +29,13 @@ process.on('message', function(stuff){
var highMark = stuff.highMark;
async.waterfall([
function(next) {
if (signatureFunc)
if (signatureFunc && lastSecret == pair.secretKeyEnc) {
next(null, signatureFunc);
else
}
else {
lastSecret = pair.secretKeyEnc;
signature.sync(pair, next);
}
},
function(sigFunc, next) {
signatureFunc = sigFunc;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment