From 11776dbb63674cf394fe439c97f0cad7547032a4 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 29 Oct 2018 20:21:47 -0400 Subject: [PATCH] Add warnings reminding users to use SegWit funding inputs --- src/ln/channelmanager.rs | 3 +++ src/util/events.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/ln/channelmanager.rs b/src/ln/channelmanager.rs index ed69e8a03..d1e8eefd4 100644 --- a/src/ln/channelmanager.rs +++ b/src/ln/channelmanager.rs @@ -1233,6 +1233,9 @@ impl ChannelManager { /// Call this upon creation of a funding transaction for the given channel. /// + /// Note that ALL inputs in the transaction pointed to by funding_txo MUST spend SegWit outputs + /// or your counterparty can steal your funds! + /// /// Panics if a funding transaction has already been provided for this channel. /// /// May panic if the funding_txo is duplicative with some other channel (note that this should diff --git a/src/util/events.rs b/src/util/events.rs index 37cee2ede..a9a7d06fe 100644 --- a/src/util/events.rs +++ b/src/util/events.rs @@ -27,6 +27,8 @@ pub enum Event { /// Used to indicate that the client should generate a funding transaction with the given /// parameters and then call ChannelManager::funding_transaction_generated. /// Generated in ChannelManager message handling. + /// Note that *all inputs* in the funding transaction must spend SegWit outputs or your + /// counterparty can steal your funds! FundingGenerationReady { /// The random channel_id we picked which you'll need to pass into /// ChannelManager::funding_transaction_generated. -- 2.39.5