follow-up prev commit
This commit is contained in:
@@ -129,7 +129,7 @@ class SwapManager(Logger):
|
|||||||
async def normal_swap(self, lightning_amount, expected_onchain_amount, password):
|
async def normal_swap(self, lightning_amount, expected_onchain_amount, password):
|
||||||
privkey = os.urandom(32)
|
privkey = os.urandom(32)
|
||||||
pubkey = ECPrivkey(privkey).get_public_key_bytes(compressed=True)
|
pubkey = ECPrivkey(privkey).get_public_key_bytes(compressed=True)
|
||||||
key = await self.lnworker._add_request_coro(amount_sat, 'swap', expiry=3600*24)
|
key = await self.lnworker._add_request_coro(lightning_amount, 'swap', expiry=3600*24)
|
||||||
request = self.wallet.get_request(key)
|
request = self.wallet.get_request(key)
|
||||||
invoice = request['invoice']
|
invoice = request['invoice']
|
||||||
lnaddr = self.lnworker._check_invoice(invoice, lightning_amount)
|
lnaddr = self.lnworker._check_invoice(invoice, lightning_amount)
|
||||||
@@ -233,9 +233,6 @@ class SwapManager(Logger):
|
|||||||
self.add_lnwatcher_callback(lockup_address, onchain_amount, redeem_script, preimage, privkey, locktime)
|
self.add_lnwatcher_callback(lockup_address, onchain_amount, redeem_script, preimage, privkey, locktime)
|
||||||
# initiate payment.
|
# initiate payment.
|
||||||
success, log = await self.lnworker._pay(invoice, attempts=5)
|
success, log = await self.lnworker._pay(invoice, attempts=5)
|
||||||
# discard data; this should be done by lnwatcher
|
|
||||||
if success:
|
|
||||||
swaps.pop(response_id)
|
|
||||||
return {
|
return {
|
||||||
'id':response_id,
|
'id':response_id,
|
||||||
'success':success,
|
'success':success,
|
||||||
|
|||||||
Reference in New Issue
Block a user