Commit Graph

12 Commits

Author SHA1 Message Date
Christian Decker e972b208c7 routing: Passing back all addresses on getnodes 2017-05-10 12:37:44 +09:30
Christian Decker d87ca4121d routing: Returning channel_id to getroute requests
The new onion uses the `channel_id` instead of the `node_id` of the
next hop to identify where to forward the payment. So we return the
exact channel chosen by the routing algo, to avoid having to look it
up again later.
2017-05-02 11:47:52 +02:00
Rusty Russell a4fdaab5b3 Use global secp256k1_ctx instead of passing it around.
If I'd known how large this patch would be (though trivial), I'd
have done it in parts.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-02 18:12:58 +10:30
Rusty Russell ca80fc0286 getroute: add a risk factor.
We need some way to reflect the tradeoff between the possible delay if
a payment gets stuck, and the fees charged by nodes.  This adds a risk
factor which reflects the probability that a node goes down, and the
cost associated with losing access to our funds for a given time.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-09-06 16:47:48 +09:30
Rusty Russell a4346b56f6 json: remove unused json_get_arr parameter.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-31 17:19:40 +09:30
Rusty Russell 2610799bda 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>
2016-08-31 16:06:08 +09:30
Rusty Russell b9d4f7c0ab daemon: dev-output command.
Useful for controlling conversations between two nodes, by
blocking one's output.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-05-26 15:25:24 +09:30
Rusty Russell 71c02c7b4c daemon: make json_get_param() understand which args are compulsory.
So far only one isn't, so this saves us some checks.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-03-15 17:07:30 +10:30
Rusty Russell aed857a30c json: routine to create a uint64_t field.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:48 +10:30
Rusty Russell 725512fb03 json: parse bitcoind-style bitcoin amount.
Always of form d*.dddddddd; we turn that into satoshis, because we're
sane.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:48 +10:30
Rusty Russell 06a25887da json: routine to parse a uint64_t.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:48 +10:30
Rusty Russell ac4491909c daemon/json: helpers for using jsmn.
Also taken from pettycoin.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:48 +10:30