onion: Print the extracted channel_update and onionreply to debug

This adds one line with the onion and the channel_update we extract from
it. This in turn allows us to check that the channel_update in the onion is not
type prefixed, and that we patch it correctly before passing it to gossipd.
This commit is contained in:
Christian Decker
2018-07-30 18:01:34 +02:00
committed by Rusty Russell
parent 6bbea741d1
commit d3edfc8028
3 changed files with 19 additions and 3 deletions

View File

@@ -4725,6 +4725,13 @@ class LightningDTests(BaseLightningDTests):
self.assertRaisesRegex(RpcError, 'WIRE_TEMPORARY_CHANNEL_FAILURE',
l1.rpc.waitsendpay, inv['payment_hash'])
# Make sure we get an onionreply, without the type prefix of the nested
# channel_update, and it should patch it to include a type prefix. The
# prefix 0x0102 should be in the channel_update, but not in the
# onionreply (negation of 0x0102 in the RE)
l1.daemon.wait_for_log(r'Extracted channel_update 0102.*from onionreply 10070080(?!.*0102)')
# And now monitor for l1 to apply the channel_update we just extracted
l1.daemon.wait_for_log('Received channel_update for channel {}\(.\) now DISABLED was ACTIVE \(from error\)'.format(chanid2))
def test_address(self):