return preimage from sendPayment()
This commit is contained in:
parent
1c3520f785
commit
72ca45c853
1 changed files with 4 additions and 1 deletions
|
|
@ -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<void>}
|
||||
* @returns {Promise<string>} 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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue