-
Notifications
You must be signed in to change notification settings - Fork 913
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgradewallet: JSONRPC call to update p2sh outputs to a native segwit
v2 opens require you to use native segwit inputs Changelog-Added: JSONRPC: `upgradewallet` command, sweeps all p2sh-wrapped outputs to a native segwit output
- Loading branch information
Showing
7 changed files
with
324 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
lightning-upgradewallet -- Command to spend all P2SH-wrapped inputs into a Native Segwit output | ||
================================================================ | ||
|
||
SYNOPSIS | ||
-------- | ||
|
||
**upgradewallet** [*feerate*] [*reservedok*] | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped | ||
Segwit deposits in a wallet into a single Native Segwit P2WPKH address. | ||
|
||
*feerate* can be one of the feerates listed in lightning-feerates(7), | ||
or one of the strings *urgent* (aim for next block), *normal* (next 4 | ||
blocks or so) or *slow* (next 100 blocks or so) to use lightningd's | ||
internal estimates. It can also be a *feerate* is a number, with an | ||
optional suffix: *perkw* means the number is interpreted as | ||
satoshi-per-kilosipa (weight), and *perkb* means it is interpreted | ||
bitcoind-style as satoshi-per-kilobyte. Omitting the suffix is | ||
equivalent to *perkb*. | ||
|
||
*reservedok* tells the wallet to include all P2SH-wrapped inputs, including | ||
reserved ones. | ||
|
||
EXAMPLE USAGE | ||
------------- | ||
|
||
The caller is trying to buy a liquidity ad but the command keeps failing. | ||
They have funds in their wallet, but they're all P2SH-wrapped outputs. | ||
|
||
The caller can call `upgradewallet` to convert their funds to native segwit | ||
outputs, which are valid for liquidity ad buys. | ||
|
||
RETURN VALUE | ||
------------ | ||
|
||
[comment]: # (GENERATE-FROM-SCHEMA-START) | ||
[comment]: # (GENERATE-FROM-SCHEMA-END) | ||
|
||
|
||
AUTHOR | ||
------ | ||
|
||
~niftynei~ <<niftynei@gmail.com>> is mainly responsible. | ||
|
||
SEE ALSO | ||
-------- | ||
|
||
lightning-utxopsbt(7), lightning-reserveinputs(7), lightning-unreserveinputs(7). | ||
|
||
RESOURCES | ||
--------- | ||
|
||
Main web site: <https://github.com/ElementsProject/lightning> | ||
|
||
[comment]: # ( SHA256STAMP:0f290582f49c6103258b7f781a9e7fa4075ec6c05335a459a91da0b6fd58c68d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"required": [], | ||
"additionalProperties": false, | ||
"properties": { | ||
"feerate": { | ||
"type": "feerate", | ||
"description": "Feerate for the upgrade transaction" | ||
}, | ||
"reservedok": { | ||
"type": "boolean", | ||
"description": "Include already reserved funds or not" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"upgraded_outs" | ||
], | ||
"properties": { | ||
"upgraded_outs": { | ||
"type": "u64", | ||
"description": "Count of spent/upgraded UTXOs" | ||
}, | ||
"psbt": { | ||
"type": "string", | ||
"description": "The PSBT that was finalized and sent" | ||
}, | ||
"tx": { | ||
"type": "hex", | ||
"description": "The raw transaction which was sent" | ||
}, | ||
"txid": { | ||
"type": "txid", | ||
"description": "The txid of the **tx**" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.