<p>Since the issue was present on regtest environment only, I found out that the channel establishment didn't collect enough confirmations. In the environment I have been using, it was enough to change the behaviour of the mining nodes to mine new blocks more frequently, while on <a href="https://github.com/jamaljsr/polar" rel="nofollow noreferrer">polar</a> for example I did quick mining for several times. For other ways to simulate mining refer to <a href="https://bitcoin.stackexchange.com/questions/77389/bitcoin-regtest-mining">Bitcoin regtest mining</a>.</p>
<p>I found out that the channel get announced after at least 6 confirmations<img src="https://i.sstatic.net/hscz4.jpg" alt="docs" /></p>

CC BY-SA 4.0
2022-12-07T13:11:53.600Z
2022-12-07T13:11:53.600Z
kostjaigin
<p>The exclude parameter is a <strong>channel ID</strong>, not a <strong>node ID</strong>. You should specify the ID of the A&lt;-&gt;C channel (in the right, or in both directions), in order to exclude the A-&gt;C direct path.</p>
<p>See the documentation of <code>getroute</code> in the help of lightning-cli (of C-lightning): <code>lightning-cli help getroute</code>.</p>
<p><em>&quot;exclude is a JSON array of short-channel-id/direction (e.g. [ &quot;564334x877x1/0&quot;, &quot;564195x1292x0/1&quot; ]) or node-id which should be excluded from consideration for routing.  The default is not to exclude any channels or nodes. Note if the source or destination is excluded, the command result is undefined.&quot;</em></p>

CC BY-SA 4.0
2022-12-07T13:06:23.243Z
Thank you for you answer! If you take a closer look at the very same piece of documentation you provided, you will see:

`or node-id which should be excluded from consideration for routing`

Additionally, I copied this behavior from one of the most supported plugins in the lightning environment - rebalance.py.
kostjaigin
CC BY-SA 4.0
2022-12-06T21:47:11.507Z
2022-12-06T21:47:11.507Z
OptOut
<p>I am super new to lightning development and just starting to play around with stuff and wanted to execute some circular rebalancing payments, but was confronted with problems coming from the <code>getroute</code> method</p>
<p>My problem: I setup a regtest graph consisting of 3 nodes
A&lt;—(25Ksat)-(40Ksat)-(15Ksat)—&gt;B&lt;—(35Ksat)-(65Ksat)-(30Ksat)—&gt;C&lt;—(60Ksat)-(90Ksat)-(30Ksat)—&gt;A.</p>
<p>From the node A I execute</p>
<p><code>lcli getroute &lt;C_ID&gt; 5000sat 0 &lt;TRIED_ALL_VALUES&gt; &lt;A_ID&gt; 100.0 [&quot;&lt;C_ID&gt;&quot;]</code></p>
<p>excludes contains C_ID to avoid showing direct connections. When excludes contains &lt;A_ID&gt; the direct connection is proposed. I hope to see the A—&gt;B—&gt;C route, but only get A—&gt;C.</p>
<p>Now, all the channels I created are publicly announced, but if I try to execute <code>lcli listchannels</code> on any of my nodes, <strong>I end seeing only my channels</strong>. What did I miss? Additionally, if I execute <code>lcli listnodes</code> I only see my direct peers, not the other nodes on the network. As if the announcements on the gossip network do not come though.</p>
<p>I am super grateful for any hint or thought!</p>
<p>Every node has the same config. Here are the configs from <code>lcli listconfigs</code> (except the plugins section, which is quite large and would be distracting):</p>
<pre><code>{
   &quot;# version&quot;: &quot;v0.12.1&quot;,
   &quot;conf&quot;: &quot;/root/.lightning/config&quot;,
   &quot;lightning-dir&quot;: &quot;/data/lightning&quot;,
   &quot;network&quot;: &quot;regtest&quot;,
   &quot;allow-deprecated-apis&quot;: true,
   &quot;rpc-file&quot;: &quot;lightning-rpc&quot;,
   &quot;plugins&quot;: [...],
   &quot;important-plugins&quot;: [...],
   &quot;always-use-proxy&quot;: false,
   &quot;daemon&quot;: true,
   &quot;wallet&quot;: &quot;sqlite3:///data/lightning/regtest/lightningd.sqlite3&quot;,
   &quot;large-channels&quot;: false,
   &quot;experimental-dual-fund&quot;: false,
   &quot;experimental-onion-messages&quot;: false,
   &quot;experimental-offers&quot;: false,
   &quot;experimental-shutdown-wrong-funding&quot;: false,
   &quot;rgb&quot;: &quot;03dac7&quot;,
   &quot;alias&quot;: &quot;IRATEGENESIS-v0.12.1&quot;,
   &quot;pid-file&quot;: &quot;/data/lightning/lightningd-regtest.pid&quot;,
   &quot;ignore-fee-limits&quot;: true,
   &quot;watchtime-blocks&quot;: 6,
   &quot;max-locktime-blocks&quot;: 2016,
   &quot;funding-confirms&quot;: 1,
   &quot;cltv-delta&quot;: 6,
   &quot;cltv-final&quot;: 20,
   &quot;commit-time&quot;: 10,
   &quot;fee-base&quot;: 0,
   &quot;rescan&quot;: 30,
   &quot;fee-per-satoshi&quot;: 0,
   &quot;htlc-minimum-msat&quot;: &quot;0msat&quot;,
   &quot;htlc-maximum-msat&quot;: &quot;18446744073709551615msat&quot;,
   &quot;max-concurrent-htlcs&quot;: 483,
   &quot;max-dust-htlc-exposure-msat&quot;: &quot;50000000msat&quot;,
   &quot;min-capacity-sat&quot;: 10000,
   &quot;disable-ip-discovery&quot;: false,
   &quot;offline&quot;: false,
   &quot;autolisten&quot;: true,
   &quot;disable-dns&quot;: false,
   &quot;encrypted-hsm&quot;: false,
   &quot;rpc-file-mode&quot;: &quot;0600&quot;,
   &quot;log-level&quot;: &quot;info&quot;,
   &quot;log-timestamps&quot;: true,
   &quot;log-prefix&quot;: &quot;&quot;,
   &quot;log-file&quot;: &quot;/var/log/lightning/lightningd.log&quot;
}
</code></pre>
<p>And here is the result of <code>lcli getinfo</code>:</p>
<pre><code>{
   &quot;id&quot;: &quot;03dac78928a90839c2e7a4ba1e5a1567466f944ba1345cfe1fee9da226f1a34aef&quot;,
   &quot;alias&quot;: &quot;IRATEGENESIS-v0.12.1&quot;,
   &quot;color&quot;: &quot;03dac7&quot;,
   &quot;num_peers&quot;: 2,
   &quot;num_pending_channels&quot;: 0,
   &quot;num_active_channels&quot;: 2,
   &quot;num_inactive_channels&quot;: 0,
   &quot;address&quot;: [],
   &quot;binding&quot;: [
      {
         &quot;type&quot;: &quot;ipv6&quot;,
         &quot;address&quot;: &quot;::&quot;,
         &quot;port&quot;: 19846
      },
      {
         &quot;type&quot;: &quot;ipv4&quot;,
         &quot;address&quot;: &quot;0.0.0.0&quot;,
         &quot;port&quot;: 19846
      }
   ],
   &quot;version&quot;: &quot;v0.12.1&quot;,
   &quot;blockheight&quot;: 162,
   &quot;network&quot;: &quot;regtest&quot;,
   &quot;msatoshi_fees_collected&quot;: 0,
   &quot;fees_collected_msat&quot;: &quot;0msat&quot;,
   &quot;lightning-dir&quot;: &quot;/data/lightning/regtest&quot;,
   &quot;our_features&quot;: {
      &quot;init&quot;: &quot;08a000080269a2&quot;,
      &quot;node&quot;: &quot;88a000080269a2&quot;,
      &quot;channel&quot;: &quot;&quot;,
      &quot;invoice&quot;: &quot;02000000024100&quot;
   }
}
</code></pre>

CC BY-SA 4.0
2022-12-06T12:40:33.253Z
Which node implementation are you using? I could not guess from the `lcli` name (LND client is usually `lncli`, C-lightning client `lightning-cli`).
OptOut
CC BY-SA 4.0
2022-12-06T21:53:04.310Z
From the syntax of `getroute` I infer it is C-lightning.
OptOut
<lightning-network><regtest><core-lightning>
C-Lightning Gossiping and Channel announcements
kostjaigin
# C-Lightning Gossiping and Channel announcements

(Asked by: username_0 on 2022-12-04)

I am super new to lightning development and just starting to play around with stuff and wanted to execute some circular rebalancing payments, but was confronted with problems coming from the `getroute` method

My problem: I setup a regtest graph consisting of 3 nodes
A<—(25Ksat)-(40Ksat)-(15Ksat)—>B<—(35Ksat)-(65Ksat)-(30Ksat)—>C<—(60Ksat)-(90Ksat)-(30Ksat)—>A.

From the node A I execute

`lcli getroute <C_ID> 5000sat 0 <TRIED_ALL_VALUES> <A_ID> 100.0 ["<C_ID>"]`

excludes contains C\_ID to avoid showing direct connections. When excludes contains <A\_ID> the direct connection is proposed. I hope to see the A—>B—>C route, but only get A—>C.

Now, all the channels I created are publicly announced, but if I try to execute `lcli listchannels` on any of my nodes, **I end seeing only my channels**. What did I miss? Additionally, if I execute `lcli listnodes` I only see my direct peers, not the other nodes on the network. As if the announcements on the gossip network do not come though.

I am super grateful for any hint or thought!

Every node has the same config. Here are the configs from `lcli listconfigs` (except the plugins section, which is quite large and would be distracting):

```
{
   "# version": "v0.12.1",
   "conf": "/root/.lightning/config",
   "lightning-dir": "/data/lightning",
   "network": "regtest",
   "allow-deprecated-apis": true,
   "rpc-file": "lightning-rpc",
   "plugins": [...],
   "important-plugins": [...],
   "always-use-proxy": false,
   "daemon": true,
   "wallet": "sqlite3:///data/lightning/regtest/lightningd.sqlite3",
   "large-channels": false,
   "experimental-dual-fund": false,
   "experimental-onion-messages": false,
   "experimental-offers": false,
   "experimental-shutdown-wrong-funding": false,
   "rgb": "03dac7",
   "alias": "IRATEGENESIS-v0.12.1",
   "pid-file": "/data/lightning/lightningd-regtest.pid",
   "ignore-fee-limits": true,
   "watchtime-blocks": 6,
   "max-locktime-blocks": 2016,
   "funding-confirms": 1,
   "cltv-delta": 6,
   "cltv-final": 20,
   "commit-time": 10,
   "fee-base": 0,
   "rescan": 30,
   "fee-per-satoshi": 0,
   "htlc-minimum-msat": "0msat",
   "htlc-maximum-msat": "18446744073709551615msat",
   "max-concurrent-htlcs": 483,
   "max-dust-htlc-exposure-msat": "50000000msat",
   "min-capacity-sat": 10000,
   "disable-ip-discovery": false,
   "offline": false,
   "autolisten": true,
   "disable-dns": false,
   "encrypted-hsm": false,
   "rpc-file-mode": "0600",
   "log-level": "info",
   "log-timestamps": true,
   "log-prefix": "",
   "log-file": "/var/log/lightning/lightningd.log"
}

```

And here is the result of `lcli getinfo`:

```
{
   "id": "03dac78928a90839c2e7a4ba1e5a1567466f944ba1345cfe1fee9da226f1a34aef",
   "alias": "IRATEGENESIS-v0.12.1",
   "color": "03dac7",
   "num_peers": 2,
   "num_pending_channels": 0,
   "num_active_channels": 2,
   "num_inactive_channels": 0,
   "address": [],
   "binding": [
      {
         "type": "ipv6",
         "address": "::",
         "port": 19846
      },
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 19846
      }
   ],
   "version": "v0.12.1",
   "blockheight": 162,
   "network": "regtest",
   "msatoshi_fees_collected": 0,
   "fees_collected_msat": "0msat",
   "lightning-dir": "/data/lightning/regtest",
   "our_features": {
      "init": "08a000080269a2",
      "node": "88a000080269a2",
      "channel": "",
      "invoice": "02000000024100"
   }
}

```

**Tags:** lightning-network, regtest, core-lightning

> **Comments:**
> **username_1**: Which node implementation are you using? I could not guess from the `lcli` name (LND client is usually `lncli`, C-lightning client `lightning-cli`).  
> **username_1**: From the syntax of `getroute` I infer it is C-lightning.  

---

## 2 answers

### Answer by username_0 on 2022-12-07. Score: 1 | Accepted answer

Since the issue was present on regtest environment only, I found out that the channel establishment didn't collect enough confirmations. In the environment I have been using, it was enough to change the behaviour of the mining nodes to mine new blocks more frequently, while on [polar](https://github.com/jamaljsr/polar) for example I did quick mining for several times. For other ways to simulate mining refer to [Bitcoin regtest mining](https://bitcoin.stackexchange.com/questions/77389/bitcoin-regtest-mining).

I found out that the channel get announced after at least 6 confirmations![docs](https://i.sstatic.net/hscz4.jpg)


---

### Answer by username_1 on 2022-12-06. Score: 0

The exclude parameter is a **channel ID**, not a **node ID**. You should specify the ID of the A<->C channel (in the right, or in both directions), in order to exclude the A->C direct path.

See the documentation of `getroute` in the help of lightning-cli (of C-lightning): `lightning-cli help getroute`.

*"exclude is a JSON array of short-channel-id/direction (e.g. [ "564334x877x1/0", "564195x1292x0/1" ]) or node-id which should be excluded from consideration for routing. The default is not to exclude any channels or nodes. Note if the source or destination is excluded, the command result is undefined."*

> **Comments:**
> **username_0**: Thank you for you answer! If you take a closer look at the very same piece of documentation you provided, you will see:  `or node-id which should be excluded from consideration for routing`  Additionally, I copied this behavior from one of the most supported plugins in the lightning environment - rebalance.py.  

---

