rgb-cln/doc/lightning-reserveinputs.7.md

68 lines
2.2 KiB
Markdown
Raw Normal View History

2020-06-10 01:20:18 +01:00
lightning-reserveinputs -- Construct a transaction and reserve the UTXOs it spends
==================================================================================
SYNOPSIS
--------
2022-01-26 17:18:49 +00:00
**reserveinputs** *psbt* [*exclusive*] [*reserve*]
2020-06-10 01:20:18 +01:00
DESCRIPTION
-----------
The **reserveinputs** RPC command places (or increases) reservations on any
inputs specified in *psbt* which are known to lightningd. It will fail
with an error if any of the inputs are known to be spent, and ignore inputs
which are unknown.
2020-06-10 01:20:18 +01:00
Normally the command will fail (with no reservations made) if an input
is already reserved. If *exclusive* is set to *False*, then existing
reservations are simply extended, rather than causing failure.
By default, reservations are for the next 72 blocks (approximately 6
hours), but this can be changed by setting *reserve*.
2020-06-10 01:20:18 +01:00
RETURN VALUE
------------
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object containing **reservations** is returned. It is an array of objects, where each object contains:
- **txid** (txid): the transaction id
- **vout** (u32): the output number which was reserved
- **was\_reserved** (boolean): whether the input was already reserved
- **reserved** (boolean): whether the input is now reserved (always *true*)
- **reserved\_to\_block** (u32): what blockheight the reservation will expire
[comment]: # (GENERATE-FROM-SCHEMA-END)
On success, a *reservations* array is returned, with an entry for each input
which was reserved:
- *txid* is the input transaction id.
- *vout* is the input index.
doc: escape more naughty underscores The only time underscores aren't special in Markdown is when they appear in preformatted text. We have gotten away with not escaping underscores where an asterisk-enclosed span or the paragraph ends before the next underscore appears, but this is fragile and bad practice. Conversely, there are many places where we have not escaped underscores but needed to. Escape all underscores that do not appear in preformatted blocks or preformatted spans and are not themselves delineating emphasized spans. The changes in this commit are exactly the result of executing the following Bash code: ```bash e=':x;' # begin loop e+='s/^' # anchor match at beginning of line e+='(' # begin capturing subexpression e+='(' # begin list of alternatives e+='[^`_\\]|' # any mundane character, or e+='`([^`\\]|\\.)*`|' # backtick-enclosed span, or e+='\b_|_\b|' # underscore at boundary, or e+='\\.' # backslash-escaped character e+=')*' # any number of the preceding alternatives e+=')' # end capturing subexpression e+='\B_\B/\1\\_/;' # escape non-formatting underscore e+='tx' # repeat loop if we escaped an underscore escape_underscores=( sed # use extended regular expressions -E # skip over indented blocks (following an empty line) -e '/^$/{:i;n;/^( {4,}|\t)/bi}' # skip over preformatted blocks -e '/^\s*```/,/^\s*```/{p;d}' # skip over generated sections -e '/GENERATE-FROM-SCHEMA-START/,/GENERATE-FROM-SCHEMA-END/{p;d}' # escape underscores -e "${e}" ) "${escape_underscores[@]}" -i doc/*.[0-9].md ``` Changelog-None
2022-11-11 01:44:56 +00:00
- *was\_reserved* indicates whether the input was already reserved.
- *reserved* indicates that the input is now reserved (i.e. true).
doc: escape more naughty underscores The only time underscores aren't special in Markdown is when they appear in preformatted text. We have gotten away with not escaping underscores where an asterisk-enclosed span or the paragraph ends before the next underscore appears, but this is fragile and bad practice. Conversely, there are many places where we have not escaped underscores but needed to. Escape all underscores that do not appear in preformatted blocks or preformatted spans and are not themselves delineating emphasized spans. The changes in this commit are exactly the result of executing the following Bash code: ```bash e=':x;' # begin loop e+='s/^' # anchor match at beginning of line e+='(' # begin capturing subexpression e+='(' # begin list of alternatives e+='[^`_\\]|' # any mundane character, or e+='`([^`\\]|\\.)*`|' # backtick-enclosed span, or e+='\b_|_\b|' # underscore at boundary, or e+='\\.' # backslash-escaped character e+=')*' # any number of the preceding alternatives e+=')' # end capturing subexpression e+='\B_\B/\1\\_/;' # escape non-formatting underscore e+='tx' # repeat loop if we escaped an underscore escape_underscores=( sed # use extended regular expressions -E # skip over indented blocks (following an empty line) -e '/^$/{:i;n;/^( {4,}|\t)/bi}' # skip over preformatted blocks -e '/^\s*```/,/^\s*```/{p;d}' # skip over generated sections -e '/GENERATE-FROM-SCHEMA-START/,/GENERATE-FROM-SCHEMA-END/{p;d}' # escape underscores -e "${e}" ) "${escape_underscores[@]}" -i doc/*.[0-9].md ``` Changelog-None
2022-11-11 01:44:56 +00:00
- *reserved\_to\_block* indicates what blockheight the reservation will expire.
2020-06-10 01:20:18 +01:00
On failure, an error is reported and no UTXOs are reserved.
The following error codes may occur:
- -32602: Invalid parameter, such as specifying a spent/reserved input in *psbt*.
2020-06-10 01:20:18 +01:00
AUTHOR
------
niftynei <<niftynei@gmail.com>> is mainly responsible.
SEE ALSO
--------
lightning-unreserveinputs(7), lightning-signpsbt(7), lightning-sendpsbt(7)
RESOURCES
---------
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:0df4568eb6977f3837270b935c26792bc08d18cfa05ce0c517aae880cf0b497b)