Browse Source

add config variable to test update_fail_malformed_htlc

master
ThomasV 6 years ago
parent
commit
ab188ff375
  1. 1
      electrum/lnpeer.py
  2. 1
      electrum/tests/regtest/regtest.sh

1
electrum/lnpeer.py

@ -1495,6 +1495,7 @@ class Peer(Logger):
onion_packet_bytes = bytes.fromhex(onion_packet_hex)
onion_packet = None
try:
if self.network.config.get('test_fail_malformed_htlc'): raise InvalidOnionPubkey()
onion_packet = OnionPacket.from_bytes(onion_packet_bytes)
processed_onion = process_onion_packet(onion_packet, associated_data=payment_hash, our_onion_private_key=self.privkey)
except UnsupportedOnionPacketVersion:

1
electrum/tests/regtest/regtest.sh

@ -104,6 +104,7 @@ fi
if [[ $1 == "configure_test_forwarding" ]]; then
$bob setconfig --offline lightning_forward_payments true
# $carol setconfig --offline test_fail_malformed_htlc true # uncomment to test update_fail_malformed_htlc
fi
if [[ $1 == "open" ]]; then

Loading…
Cancel
Save