Skip to content

Commit

Permalink
remove references to the "private" field of listpeers channel info
Browse files Browse the repository at this point in the history
Fixes issue ([#193])

Changelog-Fixed: Removed references to deprecated "private" field of channel info returned from API.
  • Loading branch information
ksedgwic committed Apr 16, 2024
1 parent cd56d0d commit 2c7ce2f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 25 deletions.
5 changes: 0 additions & 5 deletions Boss/Mod/EarningsRebalancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ class EarningsRebalancer::Impl {
));

for (auto c : p["channels"]) {
auto priv = bool(
c["private"]
);
if (priv)
continue;
auto state = std::string(
c["state"]
);
Expand Down
5 changes: 0 additions & 5 deletions Boss/Mod/InitialRebalancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ class InitialRebalancer::Impl::Run::Impl

auto cs = p["channels"];
for (auto c : cs) {
auto priv = bool(
c["private"]
);
if (priv)
continue;
auto state = std::string(
c["state"]
);
Expand Down
6 changes: 0 additions & 6 deletions Boss/Mod/NodeBalanceSwapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ class NodeBalanceSwapper::Impl : ModG::Swapper {
!= "CHANNELD_NORMAL"
)
continue;
/* Skip unpublished channels,
* they cannot be used for
* forwarding anyway.
*/
if (chan["private"])
continue;
auto recv = Ln::Amount();
auto send = Ln::Amount();
compute_sendable_receivable(
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
converted to `amount_msat` instead. This caused channel candidates
to not be found ([#189]) (and maybe other problems). Fixed in
([#190]).
- CLN `v24.02` deprecated the RPC `private` field in the channel info
RPC data because private channels are no longer present. Remove
references to the field because we only want to skip these channels
anyway. Fixes ([192])

### Changed

Expand Down
1 change: 0 additions & 1 deletion tests/boss/test_earningsrebalancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class Model {
.field("id", std::string(p.first))
.start_array("channels")
.start_object()
.field("private", false)
.field("state", "CHANNELD_NORMAL")
.field("to_us_msat", std::string(p.second.to_us))
.field("total_msat", std::string(p.second.total))
Expand Down
12 changes: 4 additions & 8 deletions tests/boss/test_initialrebalancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,15 @@ class DummyEarningsManager {
*/
auto const peers = std::string(R"JSON(
[ { "id" : "020000000000000000000000000000000000000000000000000000000000000000"
, "channels" : [ { "private" : false
, "state" : "CHANNELD_NORMAL"
, "channels" : [ { "state" : "CHANNELD_NORMAL"
, "to_us_msat" : "1000000000msat"
, "total_msat" : "1000000000msat"
, "htlcs" : []
}
]
}
, { "id" : "020000000000000000000000000000000000000000000000000000000000000001"
, "channels" : [ { "private" : false
, "state" : "CHANNELD_NORMAL"
, "channels" : [ { "state" : "CHANNELD_NORMAL"
, "to_us_msat" : "0msat"
, "total_msat" : "1000000000msat"
, "htlcs" : []
Expand All @@ -73,17 +71,15 @@ auto const peers = std::string(R"JSON(
, { "id" : "020000000000000000000000000000000000000000000000000000000000000003"
, "channels" : [ { "private" : false
, "state" : "CHANNELD_NORMAL"
, "channels" : [ { "state" : "CHANNELD_NORMAL"
, "to_us_msat" : "0msat"
, "total_msat" : "1000000000msat"
, "htlcs" : []
}
]
}
, { "id" : "020000000000000000000000000000000000000000000000000000000000000004"
, "channels" : [ { "private" : false
, "state" : "CHANNELD_NORMAL"
, "channels" : [ { "state" : "CHANNELD_NORMAL"
, "to_us_msat" : "1000000000msat"
, "total_msat" : "1000000000msat"
, "htlcs" : []
Expand Down

0 comments on commit 2c7ce2f

Please sign in to comment.