mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
b327bd30c3
Without this, we have hardly any enforcement. This is why the schema mistake fixed in the previous patches weren't spotted immediately. The hard work was done by: ``` $ for f in lightning-*.json; do grep -v '^ "additionalProperties": false,' $f | bagto $f; done $ for f in lightning-*.json; do sed 's/"properties": {/"additionalProperties": false, "properties": {/' $f | bagto $f; done $ make fmt-schemas ``` Then checking where 'additionalProperties: true' had been turned to false (we deliberately use it in some places where there are if statements in the schema, or occasionally where there can be arbitrary fields). [Including doc/rpc-schema-draft.json update by Shahana] Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
93 lines
2.9 KiB
JSON
93 lines
2.9 KiB
JSON
{
|
|
"$schema": "../rpc-schema-draft.json",
|
|
"type": "object",
|
|
"rpc": "fundchannel_cancel",
|
|
"title": "Command for completing channel establishment",
|
|
"description": [
|
|
"`fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer.",
|
|
"",
|
|
"Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds.",
|
|
"",
|
|
"If `fundchannel_cancel` is called after `fundchannel_complete`, the remote peer may disconnect when command succeeds. In this case, user need to connect to remote peer again before opening channel."
|
|
],
|
|
"request": {
|
|
"required": [
|
|
"id"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": {
|
|
"type": "pubkey",
|
|
"description": [
|
|
"Node id of the remote peer with which to cancel."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"response": {
|
|
"required": [
|
|
"cancelled"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"cancelled": {
|
|
"type": "string",
|
|
"description": [
|
|
"A message indicating it was cancelled by RPC."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"errors": [
|
|
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
|
"",
|
|
"- -32602: If the given parameters are wrong.",
|
|
"- 306: Unknown peer id.",
|
|
"- 307: No channel currently being funded that can be cancelled.",
|
|
"- 308: It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us."
|
|
],
|
|
"author": [
|
|
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
|
],
|
|
"see_also": [
|
|
"lightning-connect(7)",
|
|
"lightning-fundchannel(7)",
|
|
"lightning-multifundchannel(7)",
|
|
"lightning-fundchannel_start(7)",
|
|
"lightning-fundchannel_complete(7)",
|
|
"lightning-openchannel_init(7)",
|
|
"lightning-openchannel_update(7)",
|
|
"lightning-openchannel_signed(7)",
|
|
"lightning-openchannel_abort(7)"
|
|
],
|
|
"resources": [
|
|
"Main web site: <https://github.com/ElementsProject/lightning>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:fundchannel_cancel#1",
|
|
"method": "fundchannel_cancel",
|
|
"params": [
|
|
"027ba5906fad81fcdbb774b4c806eb572b7fac3bee4720b12c44e7f70931d4b7cc"
|
|
]
|
|
},
|
|
"response": {
|
|
"cancelled": "Channel open canceled by RPC"
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:fundchannel_cancel#2",
|
|
"method": "fundchannel_cancel",
|
|
"params": {
|
|
"id": "027ba5906fad81fcdbb774b4c806eb572b7fac3bee4720b12c44e7f70931d4b7cc"
|
|
}
|
|
},
|
|
"response": {
|
|
"cancelled": "Channel open canceled by RPC"
|
|
}
|
|
}
|
|
]
|
|
}
|