Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
refactor: more logging for custom ln methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Oct 18, 2020
1 parent 4e1fb8f commit 3a3f006
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion services/grpc/lightning.methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ async function ensurePeerConnected(payload = {}) {
if (peer) {
return peer
}
return this.connectPeer({ addr: payload })
const finalPayload = { addr: payload }
logGrpcCmd('Lightning.connectPeer', finalPayload)
return this.connectPeer({ addr: finalPayload })
}

/**
Expand All @@ -119,6 +121,7 @@ async function ensurePeerConnected(payload = {}) {
* @returns {Promise} OpenStatusUpdate
*/
async function connectAndOpen(payload = {}) {
logGrpcCmd('Lightning.connectAndOpen', payload)
const {
pubkey,
host,
Expand Down Expand Up @@ -159,6 +162,7 @@ async function openChannel(payload = {}) {
})
return new Promise((resolve, reject) => {
try {
logGrpcCmd('Lightning.openChannel', payload)
const call = this.service.openChannel(payload)

call.on('data', data => {
Expand Down Expand Up @@ -215,6 +219,7 @@ async function closeChannel(payload = {}) {
},
force,
}
logGrpcCmd('Lightning.closeChannel', payload)
const call = this.service.closeChannel(req)

call.on('data', data => {
Expand Down

0 comments on commit 3a3f006

Please # to comment.