@@ -9,7 +9,7 @@ void channel_hint_to_json(const char *name, const struct channel_hint *hint,
99 json_add_short_channel_id_dir (dest , "scid" , hint -> scid );
1010 json_add_amount_msat (dest , "estimated_capacity_msat" ,
1111 hint -> estimated_capacity );
12- json_add_amount_sat (dest , "capacity_sat " , hint -> capacity );
12+ json_add_amount_msat (dest , "total_capacity_msat " , hint -> capacity );
1313 json_add_bool (dest , "enabled" , hint -> enabled );
1414 json_object_end (dest );
1515}
@@ -55,9 +55,7 @@ bool channel_hint_update(const struct timeabs now, struct channel_hint *hint)
5555 * overall / refill_rate`.
5656 */
5757 struct amount_msat refill ;
58- struct amount_msat capacity ;
59- if (!amount_sat_to_msat (& capacity , hint -> capacity ))
60- abort ();
58+ struct amount_msat capacity = hint -> capacity ;
6159
6260 if (now .ts .tv_sec < hint -> timestamp + PAY_REFILL_HYSTERESIS )
6361 return true;
@@ -109,7 +107,7 @@ struct channel_hint *
109107channel_hint_set_add (struct channel_hint_set * self , u32 timestamp ,
110108 const struct short_channel_id_dir * scidd , bool enabled ,
111109 const struct amount_msat * estimated_capacity ,
112- const struct amount_sat capacity , u16 * htlc_budget )
110+ const struct amount_msat capacity , u16 * htlc_budget )
113111{
114112 struct channel_hint * copy , * old , * newhint ;
115113
@@ -143,7 +141,7 @@ channel_hint_set_add(struct channel_hint_set *self, u32 timestamp,
143141 * being told. This is because in some cases, such as
144142 * routehints, we're not actually being told the total
145143 * capacity, just lower values. */
146- if (amount_sat_greater (capacity , old -> capacity ))
144+ if (amount_msat_greater (capacity , old -> capacity ))
147145 old -> capacity = capacity ;
148146
149147 return copy ;
@@ -169,11 +167,11 @@ struct channel_hint *channel_hint_from_json(const tal_t *ctx,
169167 struct channel_hint * hint = tal (ctx , struct channel_hint );
170168
171169 ret = json_scan (ctx , buffer , jhint ,
172- "{timestamp:%,scid:%,estimated_capacity_msat:%,capacity_sat :%,enabled:%}" ,
170+ "{timestamp:%,scid:%,estimated_capacity_msat:%,total_capacity_msat :%,enabled:%}" ,
173171 JSON_SCAN (json_to_u32 , & hint -> timestamp ),
174172 JSON_SCAN (json_to_short_channel_id_dir , & hint -> scid ),
175173 JSON_SCAN (json_to_msat , & hint -> estimated_capacity ),
176- JSON_SCAN (json_to_sat , & hint -> capacity ),
174+ JSON_SCAN (json_to_msat , & hint -> capacity ),
177175 JSON_SCAN (json_to_bool , & hint -> enabled ));
178176
179177 if (ret != NULL )
0 commit comments