submarine swaps: set prepay_hash for normal swaps.
This fixes the group_id of fee prepayment transactions for the server
This commit is contained in:
@@ -155,7 +155,7 @@ class SwapManager(Logger):
|
|||||||
|
|
||||||
self.prepayments = {} # type: Dict[bytes, bytes] # fee_rhash -> rhash
|
self.prepayments = {} # type: Dict[bytes, bytes] # fee_rhash -> rhash
|
||||||
for k, swap in self.swaps.items():
|
for k, swap in self.swaps.items():
|
||||||
if swap.is_reverse and swap.prepay_hash is not None:
|
if swap.prepay_hash is not None:
|
||||||
self.prepayments[swap.prepay_hash] = bytes.fromhex(k)
|
self.prepayments[swap.prepay_hash] = bytes.fromhex(k)
|
||||||
# api url
|
# api url
|
||||||
self.api_url = wallet.config.get_swapserver_url()
|
self.api_url = wallet.config.get_swapserver_url()
|
||||||
@@ -328,6 +328,7 @@ class SwapManager(Logger):
|
|||||||
)
|
)
|
||||||
self.wallet.save_invoice(Invoice.from_bech32(invoice))
|
self.wallet.save_invoice(Invoice.from_bech32(invoice))
|
||||||
prepay_invoice = None
|
prepay_invoice = None
|
||||||
|
prepay_hash = None
|
||||||
else:
|
else:
|
||||||
onchain_amount_sat = self._get_recv_amount(lightning_amount_sat, is_reverse=True)
|
onchain_amount_sat = self._get_recv_amount(lightning_amount_sat, is_reverse=True)
|
||||||
prepay_amount_sat = self.get_claim_fee() * 2
|
prepay_amount_sat = self.get_claim_fee() * 2
|
||||||
@@ -364,7 +365,7 @@ class SwapManager(Logger):
|
|||||||
locktime = locktime,
|
locktime = locktime,
|
||||||
privkey = privkey,
|
privkey = privkey,
|
||||||
preimage = None,
|
preimage = None,
|
||||||
prepay_hash = None,
|
prepay_hash = prepay_hash,
|
||||||
lockup_address = lockup_address,
|
lockup_address = lockup_address,
|
||||||
onchain_amount = onchain_amount_sat,
|
onchain_amount = onchain_amount_sat,
|
||||||
receive_address = receive_address,
|
receive_address = receive_address,
|
||||||
|
|||||||
Reference in New Issue
Block a user