Browse Source

swapserver: sanity check amount in new flow

master
ThomasV 2 years ago
parent
commit
f5ab4b0f18
  1. 3
      electrum/submarine_swaps.py

3
electrum/submarine_swaps.py

@ -513,10 +513,11 @@ class SwapManager(Logger):
key = invoice.rhash
payment_hash = bytes.fromhex(key)
assert key in self.swaps
swap = self.swaps[key]
assert swap.lightning_amount == int(invoice.get_amount_sat())
self.wallet.save_invoice(invoice)
if pay_now:
# check that we have the preimage
swap = self.get_swap(payment_hash)
assert sha256(swap.preimage) == payment_hash
assert swap.spending_txid is None
self.invoices_to_pay[key] = 0

Loading…
Cancel
Save