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:
Rusty Russell
2019-02-21 14:15:55 +10:30
parent 0d30b89043
commit 3ac0e814d0
57 changed files with 1012 additions and 800 deletions

View File

@@ -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",