]> git.bitcoin.ninja Git - rust-lightning/commit
Fix what `bolt2_open_channel_sending_node_checks_part1` tests
authorMatt Corallo <git@bluematt.me>
Wed, 16 Feb 2022 05:36:54 +0000 (05:36 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 4 Mar 2022 21:54:21 +0000 (21:54 +0000)
commit010c34f351f4ae37c419fc5d1c55c60b637bf241
tree5a2dc1d9d31f2b17723859e79b6e34cf7c63dad2
parent6259e7a674c1e5ca216e75ffcdbe8884c167bf57
Fix what `bolt2_open_channel_sending_node_checks_part1` tests

There are currently two issues with
`bolt2_open_channel_sending_node_checks_part1` which counteract
each other and hide that the test isn't testing what it should be.

First of all, the final `create_channel` call actually fails
because we try to open a channel with ourselves, instead of
panicing as the test is supposed to check for.

However, when we fix the create_channel call to panic, when we
drop `nodes[1]` after `create_channel` panics, we fail the
no-pending-messages test as it as an expeted `accept_channel` in
its outbound buffer. This causes a double-panic.

Previously, these two offset each other - instead of panicing in
`create_channel` we'd panic in the Node drop checks.

This fixes both by fetching the `accept_channel` before we go into
the panic'ing `create_channel` call (who's arguments were
corrected).
lightning/src/ln/functional_tests.rs