Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multifundchannel #3763

Merged
merged 6 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ wallet/ @cdecker
*.py @cdecker

wallet/invoices.* @ZmnSCPxj
plugins/multifundchannel.c @ZmnSCPxj

common/param.* @wythe
common/json.* @wythe
Expand Down
10 changes: 10 additions & 0 deletions bitcoin/psbt.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ struct bitcoin_signature;
struct bitcoin_txid;
struct pubkey;

/** psbt_destroy - Destroy a PSBT that is not tal-allocated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change doesn't belong in this commit.

Since psbt_destroy is only used in psbt.c, a better fix would be to make it static.

*
* @psbt - the PSBT to destroy
*
* WARNING Do NOT call this function directly if you got the
* PSBT from create_psbt, new_psbt, psbt_from_bytes,
* psbt_from_b64, or fromwire_wally_psbt.
* Those functions register this function as a `tal_destructor`
* automatically.
*/
void psbt_destroy(struct wally_psbt *psbt);

/**
Expand Down
22 changes: 22 additions & 0 deletions contrib/pyln-client/pyln/client/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,28 @@ def listsendpays(self, bolt11=None, payment_hash=None):
}
return self.call("listsendpays", payload)

def multifundchannel(self, destinations, feerate=None, minconf=None, utxos=None, minchannels=None, **kwargs):
"""
Fund channels to an array of {destinations},
each entry of which is a dict of node {id}
and {amount} to fund, and optionally whether
to {announce} and how much {push_msat} to
give outright to the node.
You may optionally specify {feerate},
{minconf} depth, and the {utxos} set to use
for the single transaction that funds all
the channels.
"""
payload = {
"destinations": destinations,
"feerate": feerate,
"minconf": minconf,
"utxos": utxos,
"minchannels": minchannels,
}
payload.update({k: v for k, v in kwargs.items()})
return self.call("multifundchannel", payload)

def newaddr(self, addresstype=None):
"""Get a new address of type {addresstype} of the internal wallet.
"""
Expand Down
1 change: 1 addition & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ MANPAGES := doc/lightning-cli.1 \
doc/lightning-listpays.7 \
doc/lightning-listpeers.7 \
doc/lightning-listsendpays.7 \
doc/lightning-multifundchannel.7 \
doc/lightning-newaddr.7 \
doc/lightning-pay.7 \
doc/lightning-plugin.7 \
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ c-lightning Documentation
lightning-listpeers <lightning-listpeers.7.md>
lightning-listsendpays <lightning-listsendpays.7.md>
lightning-listtransactions <lightning-listtransactions.7.md>
lightning-multifundchannel <lightning-multifundchannel.7.md>
lightning-newaddr <lightning-newaddr.7.md>
lightning-pay <lightning-pay.7.md>
lightning-ping <lightning-ping.7.md>
Expand Down
6 changes: 3 additions & 3 deletions doc/lightning-fundchannel.7

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions doc/lightning-fundchannel.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This auto-connection can fail if C-lightning does not know how to contact
the target node; see lightning-connect(7).
Once the
transaction is confirmed, normal channel operations may begin. Readiness
is indicated by **listpeers** reporting a *state* of CHANNELD\_NORMAL
is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL`
for the channel.

*id* is the peer id obtained from **connect**.
Expand Down Expand Up @@ -82,7 +82,7 @@ SEE ALSO
--------

lightning-connect(7), lightning-listfunds(), lightning-listpeers(7),
lightning-feerates(7)
lightning-feerates(7), lightning-multifundchannel(7)

RESOURCES
---------
Expand Down
170 changes: 170 additions & 0 deletions doc/lightning-multifundchannel.7

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading