diff --git a/services/gunDB/contact-api/actions.js b/services/gunDB/contact-api/actions.js index aef38070..9ddb0502 100644 --- a/services/gunDB/contact-api/actions.js +++ b/services/gunDB/contact-api/actions.js @@ -876,12 +876,13 @@ const sendHRWithInitialMsg = async ( } /** + * Returns the preimage corresponding to the payment. * @param {string} to * @param {number} amount * @param {string} memo * @throws {Error} If no response in less than 20 seconds from the recipient, or * lightning cannot find a route for the payment. - * @returns {Promise} + * @returns {Promise} The payment's preimage. */ const sendPayment = async (to, amount, memo) => { try { @@ -1078,6 +1079,8 @@ const sendPayment = async (to, amount, memo) => { require('../Mediator').mySEA ) } + + return preimage } catch (e) { logger.error('Error inside sendPayment()') logger.error(e)