pay: split into getroute and sendpay

This is less convenient to use, but makes far more sense for a real
user (like a wallet).  It can ask about the route, then decide whether
to use it or not.

This will make even more sense once we add a parameter to control how
long we let the HTLC be delayed for, so a client can query for high,
medium and low tolerances and compare results.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-08-31 16:06:08 +09:30
parent 012574790d
commit 2610799bda
10 changed files with 218 additions and 87 deletions

View File

@@ -425,6 +425,17 @@ void json_add_hex(struct json_result *result, const char *fieldname,
json_add_string(result, fieldname, hex);
}
void json_add_pubkey(struct json_result *response,
secp256k1_context *secpctx,
const char *fieldname,
const struct pubkey *key)
{
u8 der[PUBKEY_DER_LEN];
pubkey_to_der(secpctx, der, key);
json_add_hex(response, fieldname, der, sizeof(der));
}
void json_add_object(struct json_result *result, ...)
{
va_list ap;