mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-12-01 11:43:58 +01:00
Update to work out the payment daemon. Not enough money transactions will flush from the queue automatically.
This commit is contained in:
+12
-7
@@ -296,13 +296,18 @@ let paymentQueue = async.queue(function (paymentDetails, callback) {
|
|||||||
global.support.rpcWallet(transferFunc, paymentDetails, function (body) {
|
global.support.rpcWallet(transferFunc, paymentDetails, function (body) {
|
||||||
debug("Payment made: " + JSON.stringify(body));
|
debug("Payment made: " + JSON.stringify(body));
|
||||||
if (body.hasOwnProperty('error')) {
|
if (body.hasOwnProperty('error')) {
|
||||||
console.error("Issue making payments" + JSON.stringify(body.error));
|
if (body.error.message === "not enough money"){
|
||||||
console.error("Will not make more payments until the payment daemon is restarted!");
|
console.error("Issue making payments, not enough money, will try later");
|
||||||
//toAddress, subject, body
|
return callback(false);
|
||||||
global.support.sendEmail(global.config.general.adminEmail, "Payment daemon unable to make payment",
|
} else {
|
||||||
"Hello,\r\nThe payment daemon has hit an issue making a payment: " + JSON.stringify(body.error) +
|
console.error("Issue making payments" + JSON.stringify(body.error));
|
||||||
". Please investigate and restart the payment daemon as appropriate");
|
console.error("Will not make more payments until the payment daemon is restarted!");
|
||||||
return;
|
//toAddress, subject, body
|
||||||
|
global.support.sendEmail(global.config.general.adminEmail, "Payment daemon unable to make payment",
|
||||||
|
"Hello,\r\nThe payment daemon has hit an issue making a payment: " + JSON.stringify(body.error) +
|
||||||
|
". Please investigate and restart the payment daemon as appropriate");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (paymentDetails.hasOwnProperty('payment_id')) {
|
if (paymentDetails.hasOwnProperty('payment_id')) {
|
||||||
console.log("Payment made to " + paymentDetails.destinations[0].address + " with PaymentID: " + paymentDetails.payment_id + " For: " + global.support.coinToDecimal(paymentDetails.destinations[0].amount) + " XMR with a " + global.support.coinToDecimal(body.result.fee) + " XMR Mining Fee");
|
console.log("Payment made to " + paymentDetails.destinations[0].address + " with PaymentID: " + paymentDetails.payment_id + " For: " + global.support.coinToDecimal(paymentDetails.destinations[0].amount) + " XMR with a " + global.support.coinToDecimal(body.result.fee) + " XMR Mining Fee");
|
||||||
|
|||||||
Reference in New Issue
Block a user