Browse Source

#4 Delete and add record in the same call

(cherry picked from commit 9ae473d26f)
master
webworker01 6 years ago
parent
commit
4124d641b0
  1. 13
      libs/paymentProcessor.js

13
libs/paymentProcessor.js

@ -421,15 +421,10 @@ function SetupForPool(logger, poolOptions, setupFinished) {
});
} else {
logger.special(logSystem, logComponent, 'Found payment opid ' + op.id );
redisClient.multi([ ['zremrangebyscore', coin + ':payments', apresult.time, apresult.time] ]).exec(function(error, results) {
if (error) {
logger.error(logSystem, logComponent, "Removed old payment failed OPID:" + op.id + " " + error);
} else {
logger.special(logSystem, logComponent, "Removed old payment success! OPID:" + op.id);
}
});
redisClient.multi([ ['zadd', coin + ':payments', apresult.time, JSON.stringify(apresult)]]).exec(function(error, results) {
redisClient.multi([
['zremrangebyscore', coin + ':payments', apresult.time, apresult.time],
['zadd', coin + ':payments', apresult.time, JSON.stringify(apresult)]
]).exec(function(error, results) {
if (error) {
logger.error(logSystem, logComponent, "Updating txid for ztransaction failed OPID:" + op.id + " " + error);
} else {

Loading…
Cancel
Save