electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 8730fa3f75c3feca7defa517a83014e73e08dbe8
parent 67d0e780b3a274e5070c0ad2181167acf5287eb1
Author: ThomasV <thomasv@electrum.org>
Date:   Sun, 23 Feb 2020 12:40:40 +0100

return preimage in lnpay. fixes #5794

Diffstat:
Melectrum/commands.py | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/electrum/commands.py b/electrum/commands.py @@ -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):