wallet: use amount_msat / amount_sat.

We change struct utxo to use amount_sat, and paper over the JSON APIs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-02-21 13:09:51 +10:30
parent 83adb94583
commit b5dcb93e5f
11 changed files with 47 additions and 30 deletions

View File

@@ -634,10 +634,11 @@ static struct command_result *add_shadow_route(struct command *cmd,
u32 cltv, best_cltv;
json_for_each_arr(i, chan, channels) {
u64 sats, v;
struct amount_sat sats;
u64 v;
json_to_u64(buf, json_get_member(buf, chan, "satoshis"), &sats);
if (sats * 1000 < pc->msatoshi)
json_to_sat(buf, json_get_member(buf, chan, "satoshis"), &sats);
if (sats.satoshis * 1000 < pc->msatoshi)
continue;
/* Don't use if total would exceed 1/4 of our time allowance. */