From a27bbbb7341c46e3e4aecbb299b71e643166d2b8 Mon Sep 17 00:00:00 2001
From: Rusty Russell <rusty@rustcorp.com.au>
Date: Tue, 30 Jan 2024 04:51:12 +1030
Subject: [PATCH] pytest: fix up test_zeroconf_multichan_forward once
 routehints fixed.

After this, the invoice (correctly!) gives the zeroconf channel as a routehint,
so this test fails.  Simple workaround: make invoice before creating zeroconf
channel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 tests/test_opening.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/test_opening.py b/tests/test_opening.py
index e7be8bc49..78f38d304 100644
--- a/tests/test_opening.py
+++ b/tests/test_opening.py
@@ -2076,6 +2076,9 @@ def test_zeroconf_multichan_forward(node_factory):
     # Just making sure the allowlisted node_id matches.
     assert l2.info['id'] == node_id
 
+    # Create invoice which doesn't use zeroconf channel as routehint!
+    inv = l3.rpc.invoice(amount_msat=10000, label='lbl1', description='desc')['bolt11']
+
     # Now create a channel that is twice as large as the real channel,
     # and don't announce it.
     l2.fundwallet(10**7)
@@ -2084,7 +2087,6 @@ def test_zeroconf_multichan_forward(node_factory):
     l2.daemon.wait_for_log(r'peer_in WIRE_CHANNEL_READY')
     l3.daemon.wait_for_log(r'peer_in WIRE_CHANNEL_READY')
 
-    inv = l3.rpc.invoice(amount_msat=10000, label='lbl1', description='desc')['bolt11']
     l1.rpc.pay(inv)
 
     for c in l2.rpc.listpeerchannels(l3.info['id'])['channels']: