diff --git a/contrib/pylightning/lightning/lightning.py b/contrib/pylightning/lightning/lightning.py index e861d31ff..e29f0175b 100644 --- a/contrib/pylightning/lightning/lightning.py +++ b/contrib/pylightning/lightning/lightning.py @@ -490,12 +490,14 @@ class LightningRpc(UnixDomainSocketRpc): } return self.call("feerates", payload) - def fundchannel(self, node_id, satoshi, feerate=None, announce=True, minconf=None): + def fundchannel(self, node_id, satoshi, feerate=None, announce=True, minconf=None, utxos=None): """ - Fund channel with {id} using {satoshi} satoshis - with feerate of {feerate} (uses default feerate if unset). + Fund channel with {id} using {satoshi} satoshis with feerate + of {feerate} (uses default feerate if unset). If {announce} is False, don't send channel announcements. - Only select outputs with {minconf} confirmations + Only select outputs with {minconf} confirmations. + If {utxos} is specified (as a list of 'txid:vout' strings), + fund a channel from these specifics utxos. """ payload = { "id": node_id, @@ -503,6 +505,7 @@ class LightningRpc(UnixDomainSocketRpc): "feerate": feerate, "announce": announce, "minconf": minconf, + "utxos": utxos } return self.call("fundchannel", payload) diff --git a/doc/lightning-fundchannel.7 b/doc/lightning-fundchannel.7 index 5ee010a0f..082c4f852 100644 --- a/doc/lightning-fundchannel.7 +++ b/doc/lightning-fundchannel.7 @@ -7,7 +7,7 @@ .\" Source: \ \& .\" Language: English .\" -.TH "LIGHTNING\-FUNDCHANN" "7" "05/24/2019" "\ \&" "\ \&" +.TH "LIGHTNING\-FUNDCHANN" "7" "06/07/2019" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ lightning-fundchannel \- Command for establishing a lightning channel\&. .SH "SYNOPSIS" .sp -\fBfundchannel\fR \fIid\fR \fIsatoshi\fR [\fIfeerate\fR \fIannounce\fR] [\fIminconf\fR] +\fBfundchannel\fR \fIid\fR \fIsatoshi\fR [\fIfeerate\fR \fIannounce\fR] [\fIminconf\fR] [\fIutxos\fR] .SH "DESCRIPTION" .sp The \fBfundchannel\fR RPC command opens a payment channel with a peer by committing a funding transaction to the blockchain as defined in BOLT #2\&. \fBfundchannel\fR by itself does not attempt to open a connection\&. A connection must first be established using \fBconnect\fR\&. Once the transaction is confirmed, normal channel operations may begin\&. Readiness is indicated by \fBlistpeers\fR reporting a \fIstate\fR of CHANNELD_NORMAL for the channel\&. @@ -47,6 +47,8 @@ The \fBfundchannel\fR RPC command opens a payment channel with a peer by committ Otherwise, \fIfeerate\fR is a number, with an optional suffix: \fIperkw\fR means the number is interpreted as satoshi\-per\-kilosipa (weight), and \fIperkb\fR means it is interpreted bitcoind\-style as satoshi\-per\-kilobyte\&. Omitting the suffix is equivalent to \fIperkb\fR\&. .sp \fIminconf\fR specifies the minimum number of confirmations that used outputs should have\&. Default is 1\&. +.sp +\fIutxos\fR specifies the utxos to be used to fund the channel, as an array of "txid:vout"\&. .SH "RETURN VALUE" .sp On success, the \fItx\fR and \fItxid\fR of the transaction is returned, as well as the \fIchannel_id\fR of the newly created channel\&. On failure, an error is reported and the channel is not funded\&. diff --git a/doc/lightning-fundchannel.7.txt b/doc/lightning-fundchannel.7.txt index d97090522..73f3f98f5 100644 --- a/doc/lightning-fundchannel.7.txt +++ b/doc/lightning-fundchannel.7.txt @@ -8,7 +8,7 @@ lightning-fundchannel - Command for establishing a lightning channel. SYNOPSIS -------- -*fundchannel* 'id' 'satoshi' ['feerate' 'announce'] ['minconf'] +*fundchannel* 'id' 'satoshi' ['feerate' 'announce'] ['minconf'] ['utxos'] DESCRIPTION ----------- @@ -45,6 +45,8 @@ satoshi-per-kilobyte. Omitting the suffix is equivalent to 'perkb'. 'minconf' specifies the minimum number of confirmations that used outputs should have. Default is 1. +'utxos' specifies the utxos to be used to fund the channel, as an array of "txid:vout". + RETURN VALUE ------------ On success, the 'tx' and 'txid' of the transaction is returned, as well as the