mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-04 23:04:35 +01:00
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
76 lines
2.7 KiB
Markdown
76 lines
2.7 KiB
Markdown
lightning-openchannel\_update -- Command to update a collab channel open
|
|
========================================================================
|
|
|
|
SYNOPSIS
|
|
--------
|
|
|
|
**openchannel\_update** *channel\_id* *psbt*
|
|
|
|
DESCRIPTION
|
|
-----------
|
|
|
|
`openchannel_update` is a low level RPC command which continues an open
|
|
channel, as specified by *channel\_id*. An updated *psbt* is passed in; any
|
|
changes from the PSBT last returned (either from `openchannel_init` or
|
|
a previous call to `openchannel_update`) will be communicated to the peer.
|
|
|
|
Must be called after `openchannel_init` and before `openchannel_signed`.
|
|
|
|
Must be called until *commitments\_secured* is returned as true, at which point
|
|
`openchannel_signed` should be called with a signed version of the PSBT
|
|
returned by the last call to `openchannel_update`.
|
|
|
|
*channel\_id* is the id of the channel.
|
|
|
|
*psbt* is the updated PSBT to be sent to the peer. May be identical to
|
|
the PSBT last returned by either `openchannel_init` or `openchannel_update`.
|
|
|
|
RETURN VALUE
|
|
------------
|
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-START)
|
|
On success, an object is returned, containing:
|
|
|
|
- **channel\_id** (hex): the channel id of the channel (always 64 characters)
|
|
- **psbt** (string): the PSBT of the funding transaction
|
|
- **commitments\_secured** (boolean): whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)
|
|
- **funding\_outnum** (u32): The index of the funding output in the psbt
|
|
- **close\_to** (hex, optional): scriptPubkey which we have to close to if we mutual close
|
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-END)
|
|
|
|
If *commitments\_secured* is true, will also return:
|
|
- The derived *channel\_id*.
|
|
- A *close\_to* script, iff a `close_to` address was provided to
|
|
`openchannel_init` and the peer supports `option_upfront_shutdownscript`.
|
|
- The *funding\_outnum*, the index of the funding output for this channel
|
|
in the funding transaction.
|
|
|
|
|
|
- -32602: If the given parameters are wrong.
|
|
- -1: Catchall nonspecific error.
|
|
- 305: Peer is not connected.
|
|
- 309: PSBT missing required fields
|
|
- 311: Unknown channel id.
|
|
- 312: Channel in an invalid state
|
|
|
|
SEE ALSO
|
|
--------
|
|
|
|
lightning-openchannel\_init(7), lightning-openchannel\_signed(7),
|
|
lightning-openchannel\_bump(7), lightning-openchannel\_abort(7),
|
|
lightning-fundchannel\_start(7), lightning-fundchannel\_complete(7),
|
|
lightning-fundchannel(7), lightning-fundpsbt(7), lightning-utxopsbt(7),
|
|
lightning-multifundchannel(7)
|
|
|
|
AUTHOR
|
|
------
|
|
|
|
@niftynei <<niftynei@gmail.com>> is mainly responsible.
|
|
|
|
RESOURCES
|
|
---------
|
|
|
|
Main web site: <https://github.com/ElementsProject/lightning>
|
|
[comment]: # ( SHA256STAMP:14632f65d4c44b34762d3fa7e0f5b823a519d3dc5fc7a2a69f677000efd937fb)
|