Skip to content

Commit

Permalink
jsonrpc: Renamed awaitpayment -> waitinvoice -> waitanyinvoice
Browse files Browse the repository at this point in the history
As suggested by Rusty
  • Loading branch information
cdecker authored and rustyrussell committed Jan 22, 2017
1 parent 1a9bfe7 commit d6ccf90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions daemon/invoice.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ static const struct json_command delinvoice_command = {
};
AUTODATA(json_command, &delinvoice_command);

static void json_waitinvoice(struct command *cmd,
static void json_waitanyinvoice(struct command *cmd,
const char *buffer, const jsmntok_t *params)
{
struct invoice *i;
Expand Down Expand Up @@ -343,21 +343,21 @@ static void json_waitinvoice(struct command *cmd,
list_add_tail(&invs->invoice_waiters, &w->list);
}

static const struct json_command waitinvoice_command = {
"waitinvoice",
json_waitinvoice,
static const struct json_command waitanyinvoice_command = {
"waitanyinvoice",
json_waitanyinvoice,
"Wait for the next invoice to be paid, after {label} (if supplied)))",
"Returns {label}, {rhash} and {msatoshi} on success. "
};
AUTODATA(json_command, &waitinvoice_command);
AUTODATA(json_command, &waitanyinvoice_command);


/* Wait for an incoming payment matching the `label` in the JSON
* command. This will either return immediately if the payment has
* already been received or it may add the `cmd` to the list of
* waiters, if the payment is still pending.
*/
static void json_awaitpayment(struct command *cmd,
static void json_waitinvoice(struct command *cmd,
const char *buffer, const jsmntok_t *params)
{
struct invoice *i;
Expand Down Expand Up @@ -392,10 +392,10 @@ static void json_awaitpayment(struct command *cmd,
list_add_tail(&invs->invoice_waiters, &w->list);
}

static const struct json_command awaitpayment_command = {
"awaitpayment",
json_awaitpayment,
static const struct json_command waitinvoice_command = {
"waitinvoice",
json_waitinvoice,
"Wait for an incoming payment matching the invoice with {label}",
"Returns {label}, {rhash} and {msatoshi} on success"
};
AUTODATA(json_command, &awaitpayment_command);
AUTODATA(json_command, &waitinvoice_command);
2 changes: 1 addition & 1 deletion daemon/test/test-routing
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fi

[ "`lcli3 listinvoice RHASH | tr -s '\012\011\" ' ' '`" = "[ { label : RHASH , rhash : $RHASH , msatoshi : $HTLC_AMOUNT, complete : true } ] " ]

[ "`lcli3 waitinvoice | tr -s '\012\011\" ' ' '`" = "{ label : RHASH , rhash : $RHASH , msatoshi : $HTLC_AMOUNT } " ]
[ "`lcli3 waitanyinvoice | tr -s '\012\011\" ' ' '`" = "{ label : RHASH , rhash : $RHASH , msatoshi : $HTLC_AMOUNT } " ]

# Can't pay twice (try from node2)
ROUTE2=`lcli2 getroute $ID3 $HTLC_AMOUNT 1`
Expand Down

0 comments on commit d6ccf90

Please sign in to comment.