Added comments
This commit is contained in:
parent
331a6e0919
commit
9d966240d2
1 changed files with 4 additions and 0 deletions
|
|
@ -1260,6 +1260,7 @@ module.exports = async (
|
||||||
};
|
};
|
||||||
logger.info("OpenChannelRequest", openChannelRequest);
|
logger.info("OpenChannelRequest", openChannelRequest);
|
||||||
const openedChannel = lightning.openChannel(openChannelRequest);
|
const openedChannel = lightning.openChannel(openChannelRequest);
|
||||||
|
// only emits one event
|
||||||
openedChannel.on("data", response => {
|
openedChannel.on("data", response => {
|
||||||
logger.debug("OpenChannelRequest:", response);
|
logger.debug("OpenChannelRequest:", response);
|
||||||
if (!res.headersSent) {
|
if (!res.headersSent) {
|
||||||
|
|
@ -1323,6 +1324,7 @@ module.exports = async (
|
||||||
// sendpayment
|
// sendpayment
|
||||||
app.post("/api/lnd/sendpayment", (req, res) => {
|
app.post("/api/lnd/sendpayment", (req, res) => {
|
||||||
const { router } = LightningServices.services;
|
const { router } = LightningServices.services;
|
||||||
|
// this is the recommended value from lightning labs
|
||||||
const { maxParts = 3, payreq } = req.body;
|
const { maxParts = 3, payreq } = req.body;
|
||||||
|
|
||||||
const paymentRequest = { payment_request: payreq, max_parts: maxParts };
|
const paymentRequest = { payment_request: payreq, max_parts: maxParts };
|
||||||
|
|
@ -1334,6 +1336,7 @@ module.exports = async (
|
||||||
logger.info("Sending payment", paymentRequest);
|
logger.info("Sending payment", paymentRequest);
|
||||||
const sentPayment = router.sendPaymentV2(paymentRequest);
|
const sentPayment = router.sendPaymentV2(paymentRequest);
|
||||||
|
|
||||||
|
// only emits one event
|
||||||
sentPayment.on("data", response => {
|
sentPayment.on("data", response => {
|
||||||
if (response.payment_error) {
|
if (response.payment_error) {
|
||||||
logger.error("SendPayment Info:", response)
|
logger.error("SendPayment Info:", response)
|
||||||
|
|
@ -1376,6 +1379,7 @@ module.exports = async (
|
||||||
no_inflight_updates: !inflightUpdates
|
no_inflight_updates: !inflightUpdates
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// only emits one event
|
||||||
trackedPayment.on("data", response => {
|
trackedPayment.on("data", response => {
|
||||||
if (response.payment_error) {
|
if (response.payment_error) {
|
||||||
logger.error("TrackPayment Info:", response)
|
logger.error("TrackPayment Info:", response)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue