mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 12:30:07 +00:00
return preimage in lnpay. fixes #5794
This commit is contained in:
parent
67d0e780b3
commit
8730fa3f75
1 changed files with 9 additions and 1 deletions
|
@ -947,7 +947,15 @@ class Commands:
|
|||
|
||||
@command('wn')
|
||||
async def lnpay(self, invoice, attempts=1, timeout=10, wallet: Abstract_Wallet = None):
|
||||
return await wallet.lnworker._pay(invoice, attempts=attempts)
|
||||
lnworker = wallet.lnworker
|
||||
lnaddr = lnworker._check_invoice(invoice, None)
|
||||
payment_hash = lnaddr.paymenthash
|
||||
success = await lnworker._pay(invoice, attempts=attempts)
|
||||
return {
|
||||
'payment_hash': payment_hash.hex(),
|
||||
'success': success,
|
||||
'preimage': lnworker.get_preimage(payment_hash).hex() if success else None,
|
||||
}
|
||||
|
||||
@command('w')
|
||||
async def nodeid(self, wallet: Abstract_Wallet = None):
|
||||
|
|
Loading…
Add table
Reference in a new issue