mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
json-rpc: Give waitblockheight
an error code for timeouts
We need to differentiate timeouts from other results, so make it recognizable.
This commit is contained in:
parent
8e908ff652
commit
0d1b45dfcc
@ -84,4 +84,7 @@ static const errcode_t OFFER_EXPIRED = 1002;
|
||||
static const errcode_t OFFER_ROUTE_NOT_FOUND = 1003;
|
||||
static const errcode_t OFFER_BAD_INVREQ_REPLY = 1004;
|
||||
|
||||
/* Errors from wait* commands */
|
||||
static const errcode_t WAIT_TIMEOUT = 2000;
|
||||
|
||||
#endif /* LIGHTNING_COMMON_JSONRPC_ERRORS_H */
|
||||
|
4
doc/lightning-waitblockheight.7
generated
4
doc/lightning-waitblockheight.7
generated
@ -23,7 +23,7 @@ the block height at the time the command returns\.
|
||||
|
||||
|
||||
If \fItimeout\fR seconds is reached without the specified blockheight
|
||||
being reached, this command will fail\.
|
||||
being reached, this command will fail with a code of \fB2000\fR\.
|
||||
|
||||
.SH AUTHOR
|
||||
|
||||
@ -33,4 +33,4 @@ ZmnSCPxj \fI<ZmnSCPxj@protonmail.com\fR> is mainly responsible\.
|
||||
|
||||
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
|
||||
|
||||
\" SHA256STAMP:5714e6333e5ba57cc00de425e6dc411f2c30812bbc8d95d01d50c460ee002e29
|
||||
\" SHA256STAMP:ac3320b4b9e679d8c407e42c9663540e2fc2aca75143d192f58ce255ca9b3700
|
||||
|
@ -24,7 +24,7 @@ an object with the single field *blockheight* is returned, which is
|
||||
the block height at the time the command returns.
|
||||
|
||||
If *timeout* seconds is reached without the specified blockheight
|
||||
being reached, this command will fail.
|
||||
being reached, this command will fail with a code of `2000`.
|
||||
|
||||
AUTHOR
|
||||
------
|
||||
|
@ -1850,7 +1850,7 @@ timeout_waitblockheight_waiter(struct waitblockheight_waiter *w)
|
||||
list_del(&w->list);
|
||||
w->removed = true;
|
||||
tal_steal(tmpctx, w);
|
||||
was_pending(command_fail(w->cmd, LIGHTNINGD,
|
||||
was_pending(command_fail(w->cmd, WAIT_TIMEOUT,
|
||||
"Timed out."));
|
||||
}
|
||||
/* Called by lightningd at each new block. */
|
||||
|
Loading…
Reference in New Issue
Block a user