mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-11 17:14:22 +01:00
daemons: use amount_msat/amount_sat in all internal wire transfers.
As a side-effect of using amount_msat in gossipd/routing.c, we explicitly handle overflows and don't need to pre-prune ridiculous-fee channels. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (read(fd, &belen, sizeof(belen)) == sizeof(belen) &&
|
||||
read(fd, &becsum, sizeof(becsum)) == sizeof(becsum)) {
|
||||
u64 satoshis;
|
||||
struct amount_sat sat;
|
||||
struct short_channel_id scid;
|
||||
u8 *gossip_msg;
|
||||
u32 msglen = be32_to_cpu(belen);
|
||||
@@ -54,9 +54,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (fromwire_gossip_store_channel_announcement(msg, msg,
|
||||
&gossip_msg,
|
||||
&satoshis)) {
|
||||
printf("channel_announce for %"PRIu64" satoshis: %s\n",
|
||||
satoshis, tal_hex(msg, gossip_msg));
|
||||
&sat)) {
|
||||
printf("channel_announce for %s: %s\n",
|
||||
type_to_string(tmpctx, struct amount_sat, &sat),
|
||||
tal_hex(msg, gossip_msg));
|
||||
} else if (fromwire_gossip_store_channel_update(msg, msg,
|
||||
&gossip_msg)) {
|
||||
printf("channel_update: %s\n",
|
||||
|
||||
@@ -38,7 +38,7 @@ static void do_generate(int argc, char **argv)
|
||||
hops_data[i].realm = i;
|
||||
memset(&hops_data[i].channel_id, i,
|
||||
sizeof(hops_data[i].channel_id));
|
||||
hops_data[i].amt_forward = i;
|
||||
hops_data[i].amt_forward.millisatoshis = i;
|
||||
hops_data[i].outgoing_cltv = i;
|
||||
fprintf(stderr, "Hopdata %d: %s\n", i, tal_hexstr(NULL, &hops_data[i], sizeof(hops_data[i])));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user