mirror of https://github.com/BTCPrivate/z-nomp.git
Merge pull request #172 from hellcatz/hellcatz-patch-13
Update paymentProcessor.js
This commit is contained in:
commit
0c341dffc9
|
@ -594,6 +594,10 @@ function SetupForPool(logger, poolOptions, setupFinished){
|
||||||
serialized: r
|
serialized: r
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
/* sort rounds by block hieght to pay in order */
|
||||||
|
rounds.sort(function(a, b) {
|
||||||
|
return a.height - b.height;
|
||||||
|
});
|
||||||
// find duplicate blocks by height
|
// find duplicate blocks by height
|
||||||
// this can happen when two or more solutions are submitted at the same block height
|
// this can happen when two or more solutions are submitted at the same block height
|
||||||
var duplicateFound = false;
|
var duplicateFound = false;
|
||||||
|
@ -757,14 +761,9 @@ function SetupForPool(logger, poolOptions, setupFinished){
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// limit blocks paid per payment round
|
// only pay max blocks at a time
|
||||||
var payingBlocks = 0;
|
var payingBlocks = 0;
|
||||||
//filter out all rounds that are immature (not confirmed or orphaned yet)
|
|
||||||
rounds = rounds.filter(function(r){
|
rounds = rounds.filter(function(r){
|
||||||
// only pay max blocks at a time
|
|
||||||
if (payingBlocks >= maxBlocksPerPayment)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
switch (r.category) {
|
switch (r.category) {
|
||||||
case 'orphan':
|
case 'orphan':
|
||||||
case 'kicked':
|
case 'kicked':
|
||||||
|
@ -772,7 +771,7 @@ function SetupForPool(logger, poolOptions, setupFinished){
|
||||||
return true;
|
return true;
|
||||||
case 'generate':
|
case 'generate':
|
||||||
payingBlocks++;
|
payingBlocks++;
|
||||||
return true;
|
return (payingBlocks <= maxBlocksPerPayment);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue