Update paymentProcessor.js

Fix issue when opids may have been cleared from node but not pool.
Do not increase opid count when `executing` as another app may have created an operation.
This commit is contained in:
hellcatz 2017-08-15 09:12:45 -07:00 committed by GitHub
parent cb2951e638
commit 81b7e2e6ee
1 changed files with 11 additions and 4 deletions

View File

@ -444,6 +444,16 @@ function SetupForPool(logger, poolOptions, setupFinished){
clearTimeout(opidTimeout);
var checkOpIdSuccessAndGetResult = function(ops) {
var batchRPC = [];
// if there are no op-ids
if (ops.length == 0) {
// and we think there is
if (opidCount !== 0) {
// clear them!
opidCount = 0;
opids = [];
logger.warning(logSystem, logComponent, 'Clearing operation ids due to empty result set.');
}
}
ops.forEach(function(op, i){
// check operation id status
if (op.status == "success" || op.status == "failed") {
@ -466,10 +476,7 @@ function SetupForPool(logger, poolOptions, setupFinished){
logger.special(logSystem, logComponent, 'Shielding operation success ' + op.id + ' txid: ' + op.result.txid);
}
} else if (op.status == "executing") {
if (opidCount == 0) {
opidCount++;
logger.special(logSystem, logComponent, 'Shielding operation in progress ' + op.id );
}
logger.special(logSystem, logComponent, 'Shielding operation in progress ' + op.id );
}
});
// if there are no completed operations