Payment processing is 98% done...

This commit is contained in:
Matt 2014-03-20 16:34:44 -06:00
parent be1b1f689c
commit eba32adde9
1 changed files with 18 additions and 6 deletions

View File

@ -357,18 +357,30 @@ function SetupForPool(logger, poolOptions){
console.log(JSON.stringify(sendManyCmd, null, 4));
return; //not yet...
daemon.cmd(sendManyCmd, function(error, result){
//if successful then do finalRedisCommands
daemon.cmd('sendmany', sendManyCmd, function(results){
if (results[0].error){
callback('done - error with sendmany ' + JSON.stringify(results[0].error));
return;
}
redisClient.multi(finalRedisCommands).exec(function(error, results){
if (error){
callback('done - error with final redis commands for cleaning up ' + JSON.stringify(error));
return;
}
callback(null, 'Payments sent');
});
});
}
], function(error, result){
console.log(error);
//log error completion
if (error)
logger.debug(error)
else{
logger.debug(result);
}
});
};