Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove references to the "private" field of channel info returned from listpeers RPC #193

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here I guess

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"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if a user run deprecated-api = false, this object is null

from cln docs of listpeers: channels (array of objects, optional) deprecated in v23.02, removed after v24.02

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 {
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this PR is a good way to remind us that listpeerchannels is now a way to iterate over all the channels?

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
Loading