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

Convert deprecated "msatoshi" fields to "amount_msat" #190

Merged
merged 1 commit into from
Apr 5, 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
9 changes: 2 additions & 7 deletions Boss/Mod/ActiveProber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ class ActiveProber::Run : public std::enable_shared_from_this<Run> {
.start_object()
.field("fromid", std::string(peer))
.field("id", std::string(dest))
.field( "msatoshi"
, std::string(amount)
)
.field("amount_msat", amount.to_msat())
/* I have written this many times,
* but I never understood riskfactor.
*/
Expand Down Expand Up @@ -407,11 +405,8 @@ class ActiveProber::Run : public std::enable_shared_from_this<Run> {
.field( "direction"
, self_id > peer ? 1 : 0
)
.field( "msatoshi"
, amount0.to_msat()
)
.field( "amount_msat"
, std::string(amount0)
, amount0.to_msat()
)
.field("delay", delay0)
.field("style", "tlv")
Expand Down
2 changes: 1 addition & 1 deletion Boss/Mod/ChannelCandidateMatchmaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ChannelCandidateMatchmaker::Run
/* 2x because the dowser will halve the channel
* capacity of the first hop.
*/
.field("msatoshi", std::string(2.0 * min_channel))
.field("amount_msat", (2.0 * min_channel).to_msat())
/* No real idea how to think about
* riskfactor.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boss/Mod/Dowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Dowser::Run : public std::enable_shared_from_this<Run> {
.start_object()
.field("id", std::string(toid))
.field("fromid", std::string(fromid))
.field("msatoshi", "1msat")
.field("amount_msat", 1)
/* I never had a decent grasp of
* riskfactor. */
.field("riskfactor", 10.0)
Expand Down
12 changes: 3 additions & 9 deletions Boss/Mod/FundsMover/Attempter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ class Attempter::Impl : public std::enable_shared_from_this<Impl> {
auto parms = Json::Out()
.start_object()
.field("id", std::string(destination))
.field( "msatoshi"
, std::string(dest_amount)
)
.field("amount_msat", dest_amount.to_msat())
.field("riskfactor", 10)
.field("cltv", cltv_delta + 14)
.field("fromid", std::string(source))
Expand Down Expand Up @@ -463,10 +461,7 @@ class Attempter::Impl : public std::enable_shared_from_this<Impl> {
.field( "direction"
, self_id > source ? 1 : 0
)
.field("msatoshi", source_amount.to_msat())
.field( "amount_msat"
, std::string(source_amount)
)
.field("amount_msat", source_amount.to_msat())
.field("delay", source_delay)
/* This used to be an explicit "style": "legacy",
* since we did not want to have to parse listnodes
Expand Down Expand Up @@ -501,8 +496,7 @@ class Attempter::Impl : public std::enable_shared_from_this<Impl> {
.field( "direction"
, destination > self_id ? 1 : 0
)
.field("msatoshi", amount.to_msat())
.field("amount_msat", std::string(amount))
.field("amount_msat", amount.to_msat())
.field("delay", 14)
/* We always support "tlv", at least for now... */
.field("style", "tlv")
Expand Down
Loading