Merge pull request #4 from TheBlueMatt/main
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Sun, 21 Mar 2021 02:52:13 +0000 (02:52 +0000)
committerGitHub <noreply@github.com>
Sun, 21 Mar 2021 02:52:13 +0000 (02:52 +0000)
Add license info

30 files changed:
LICENSE-APACHE [new file with mode: 0644]
LICENSE-MIT [new file with mode: 0644]
LICENSE.md [new file with mode: 0644]
c-bindings-gen/src/blocks.rs
c-bindings-gen/src/main.rs
c-bindings-gen/src/types.rs
lightning-c-bindings/Cargo.toml
lightning-c-bindings/include/lightning.h
lightning-c-bindings/src/chain/chaininterface.rs
lightning-c-bindings/src/chain/chainmonitor.rs
lightning-c-bindings/src/chain/channelmonitor.rs
lightning-c-bindings/src/chain/keysinterface.rs
lightning-c-bindings/src/chain/mod.rs
lightning-c-bindings/src/chain/transaction.rs
lightning-c-bindings/src/lib.rs
lightning-c-bindings/src/ln/chan_utils.rs
lightning-c-bindings/src/ln/channelmanager.rs
lightning-c-bindings/src/ln/features.rs
lightning-c-bindings/src/ln/mod.rs
lightning-c-bindings/src/ln/msgs.rs
lightning-c-bindings/src/ln/peer_handler.rs
lightning-c-bindings/src/routing/mod.rs
lightning-c-bindings/src/routing/network_graph.rs
lightning-c-bindings/src/routing/router.rs
lightning-c-bindings/src/util/config.rs
lightning-c-bindings/src/util/errors.rs
lightning-c-bindings/src/util/events.rs
lightning-c-bindings/src/util/logger.rs
lightning-c-bindings/src/util/mod.rs
lightning-c-bindings/src/util/ser.rs

diff --git a/LICENSE-APACHE b/LICENSE-APACHE
new file mode 100644 (file)
index 0000000..261eeb9
--- /dev/null
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/LICENSE-MIT b/LICENSE-MIT
new file mode 100644 (file)
index 0000000..9d982a4
--- /dev/null
@@ -0,0 +1,16 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644 (file)
index 0000000..d8b23e2
--- /dev/null
@@ -0,0 +1,13 @@
+This software is licensed under [Apache 2.0](LICENSE-APACHE) or
+[MIT](LICENSE-MIT), at your option.
+
+Some files retain their own copyright notice. However, for full authorship
+information, see version control history.
+
+Except as otherwise noted in individual files, all files in this repository are
+licensed under the Apache License, Version 2.0 <LICENSE-APACHE> or the MIT
+license <LICENSE-MIT>, at your option.
+
+You may not use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of this software or any files in this repository except in
+accordance with one or both of these licenses.
index dd57a82b5f2d557a188c8a15068d112a5f809afa..47785a726a8f1b1527b48e5b2b2ca825792c3ee8 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history.
+//
+// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE>
+// or the MIT license <LICENSE-MIT>, at your option.
+// You may not use this file except in accordance with one or both of these
+// licenses.
+
 //! Printing logic for basic blocks of Rust-mapped code - parts of functions and declarations but
 //! not the full mapping logic.
 
index 3a7bfd6c584d0d4f131ce7ea17ec2dc92487a474..dfbcb85192435f8e3226752c249194a1495ff756 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history.
+//
+// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE>
+// or the MIT license <LICENSE-MIT>, at your option.
+// You may not use this file except in accordance with one or both of these
+// licenses.
+
 //! Converts a rust crate into a rust crate containing a number of C-exported wrapper functions and
 //! classes (which is exportable using cbindgen).
 //! In general, supports convering:
@@ -1342,6 +1350,15 @@ fn convert_file<'a, 'b>(libast: &'a FullLibraryAST, crate_types: &mut CrateTypes
                let mut out = std::fs::OpenOptions::new().write(true).create(true).truncate(true)
                        .open(new_file_path).expect("Unable to open new src file");
 
+               writeln!(out, "// This file is Copyright its original authors, visible in version control").unwrap();
+               writeln!(out, "// history and in the source files from which this was generated.").unwrap();
+               writeln!(out, "//").unwrap();
+               writeln!(out, "// This file is licensed under the license available in the LICENSE or LICENSE.md").unwrap();
+               writeln!(out, "// file in the root of this repository or, if no such file exists, the same").unwrap();
+               writeln!(out, "// license as that which applies to the original source files from which this").unwrap();
+               writeln!(out, "// source was automatically generated.").unwrap();
+               writeln!(out, "").unwrap();
+
                writeln_docs(&mut out, &attrs, "");
 
                if module == "" {
index ad21b4c6bca53917685979c846021a03cdb45d7e..ba916f68c2951b0ed4510d674616fa2bc534cf92 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history.
+//
+// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE>
+// or the MIT license <LICENSE-MIT>, at your option.
+// You may not use this file except in accordance with one or both of these
+// licenses.
+
 use std::collections::{HashMap, HashSet};
 use std::fs::File;
 use std::io::Write;
index 96bd1252fa7eb56acf92f9bcb31fa946ced41aac..ef2d873586a14b4583245102a59cb328feb63d7e 100644 (file)
@@ -18,7 +18,7 @@ crate-type = ["staticlib"
 bitcoin = "0.26"
 secp256k1 = { version = "0.20.1", features = ["global-context-less-secure"] }
 # Note that the following line is matched by genbindings to update the path
-lightning = { git = "https://github.com/rust-bitcoin/rust-lightning", rev = "c9321c5ec07ee2daa895b5136e9472a42d4eff1d" }
+lightning = { git = "https://github.com/rust-bitcoin/rust-lightning", rev = "fba204b02ee4faece07a2ddf152f34507773ad4d" }
 
 [patch.crates-io]
 # Rust-Secp256k1 PR 279. Should be dropped once merged.
index 5869546d83e2ad3d860b5bc9c16d82cd4db79b63..c85ac58e919d6224d6a3e3f9388eff3012ca0fe4 100644 (file)
@@ -11,8 +11,6 @@
 
 /**
  * An error when accessing the chain via [`Access`].
- *
- * [`Access`]: trait.Access.html
  */
 typedef enum LDKAccessError {
    /**
@@ -1060,6 +1058,32 @@ typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
    bool is_owned;
 } LDKQueryShortChannelIds;
 
+
+
+/**
+ * A reply_channel_range message is a reply to a query_channel_range
+ * message. Multiple reply_channel_range messages can be sent in reply
+ * to a single query_channel_range message. The query recipient makes a
+ * best effort to respond based on their local network view which may
+ * not be a perfect view of the network. The short_channel_ids in the
+ * reply are encoded. We only support encoding_type=0 uncompressed
+ * serialization and do not support encoding_type=1 zlib serialization.
+ */
+typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeReplyChannelRange *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKReplyChannelRange;
+
 /**
  * An event generated by ChannelManager which indicates a message should be sent to a peer (or
  * broadcast to most peers).
@@ -1150,6 +1174,11 @@ typedef enum LDKMessageSendEvent_Tag {
     * their short_channel_ids.
     */
    LDKMessageSendEvent_SendShortIdsQuery,
+   /**
+    * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
+    * emitted during processing of the query.
+    */
+   LDKMessageSendEvent_SendReplyChannelRange,
    /**
     * Must be last for serialization purposes
     */
@@ -1342,6 +1371,17 @@ typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
    struct LDKQueryShortChannelIds msg;
 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
 
+typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
+   /**
+    * The node_id of this message recipient
+    */
+   struct LDKPublicKey node_id;
+   /**
+    * The reply_channel_range which should be sent.
+    */
+   struct LDKReplyChannelRange msg;
+} LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
+
 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
    LDKMessageSendEvent_Tag tag;
    union {
@@ -1363,6 +1403,7 @@ typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
       LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
       LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
       LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
+      LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
    };
 } LDKMessageSendEvent;
 
@@ -1972,8 +2013,6 @@ typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
  * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
  * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
  * preimage claim backward will lead to loss of funds.
- *
- * [`chain::Watch`]: ../trait.Watch.html
  */
 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
    /**
@@ -3018,9 +3057,9 @@ typedef struct LDKCVec_ChannelMonitorZ {
  * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
  * multiple instances.
  *
- * [`ChannelMonitor`]: channelmonitor/struct.ChannelMonitor.html
- * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
- * [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure
+ * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
+ * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
+ * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
  */
 typedef struct LDKWatch {
    /**
@@ -3035,9 +3074,9 @@ typedef struct LDKWatch {
     * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
     * calling [`block_connected`] and [`block_disconnected`] on the monitor.
     *
-    * [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch
-    * [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected
-    * [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
+    * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
+    * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
+    * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
     */
    struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
    /**
@@ -3046,8 +3085,8 @@ typedef struct LDKWatch {
     * Implementations must call [`update_monitor`] with the given update. See
     * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
     *
-    * [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor
-    * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
+    * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
+    * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
     */
    struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
    /**
@@ -4027,32 +4066,6 @@ typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
    bool result_ok;
 } LDKCResult_QueryChannelRangeDecodeErrorZ;
 
-
-
-/**
- * A reply_channel_range message is a reply to a query_channel_range
- * message. Multiple reply_channel_range messages can be sent in reply
- * to a single query_channel_range message. The query recipient makes a
- * best effort to respond based on their local network view which may
- * not be a perfect view of the network. The short_channel_ids in the
- * reply are encoded. We only support encoding_type=0 uncompressed
- * serialization and do not support encoding_type=1 zlib serialization.
- */
-typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
-   /**
-    * A pointer to the opaque Rust object.
-    * Nearly everywhere, inner must be non-null, however in places where
-    * the Rust equivalent takes an Option, it may be set to null to indicate None.
-    */
-   LDKnativeReplyChannelRange *inner;
-   /**
-    * Indicates that this is the only struct which contains the same pointer.
-    * Rust functions which take ownership of an object provided via an argument require
-    * this to be true and invalidate the object pointed to by inner.
-    */
-   bool is_owned;
-} LDKReplyChannelRange;
-
 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
    struct LDKReplyChannelRange *result;
    struct LDKDecodeError *err;
@@ -4279,11 +4292,10 @@ typedef struct LDKListen {
  *
  * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
  * should not block on I/O. Implementations should instead queue the newly monitored data to be
- * processed later. Then, in order to block until the data has been processed, any `Watch`
+ * processed later. Then, in order to block until the data has been processed, any [`Watch`]
  * invocation that has called the `Filter` must return [`TemporaryFailure`].
  *
- * [`Watch`]: trait.Watch.html
- * [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure
+ * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
  * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
  * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
  */
@@ -4336,11 +4348,8 @@ typedef struct LDKPersist {
     * stored channel data). Note that you **must** persist every new monitor to
     * disk. See the `Persist` trait documentation for more details.
     *
-    * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+    * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
     * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
-    *
-    * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
-    * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
     */
    struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
    /**
@@ -4363,14 +4372,9 @@ typedef struct LDKPersist {
     * them in batches. The size of each monitor grows `O(number of state updates)`
     * whereas updates are small and `O(1)`.
     *
-    * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+    * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
     * [`ChannelMonitorUpdate::write`] for writing out an update, and
     * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
-    *
-    * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1
-    * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
-    * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write
-    * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
     */
    struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data);
    /**
@@ -4390,9 +4394,8 @@ typedef struct LDKPersist {
  * or used independently to monitor channels remotely. See the [module-level documentation] for
  * details.
  *
- * [`chain::Watch`]: ../trait.Watch.html
- * [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
- * [module-level documentation]: index.html
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [module-level documentation]: crate::chain::chainmonitor
  */
 typedef struct MUST_USE_STRUCT LDKChainMonitor {
    /**
@@ -4550,6 +4553,10 @@ typedef struct LDKChannelMessageHandler {
     * Handle an incoming channel_reestablish message from the given peer.
     */
    void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
+   /**
+    * Handle an incoming channel update from the given peer.
+    */
+   void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
    /**
     * Handle an incoming error message from the given peer.
     */
@@ -4950,6 +4957,8 @@ extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
 
 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
 
+extern const uint16_t BREAKDOWN_TIMEOUT;
+
 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
 
 void Transaction_free(struct LDKTransaction _res);
@@ -5788,7 +5797,7 @@ void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *
  * case of an honest unilateral channel close, which implicitly decrease the economic value of
  * our channel.
  *
- * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
+ * Default value: [`BREAKDOWN_TIMEOUT`] (currently 144), we enforce it as a minimum at channel
  * opening so you can tweak config to ask for more security, not less.
  */
 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
@@ -5804,7 +5813,7 @@ uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHan
  * case of an honest unilateral channel close, which implicitly decrease the economic value of
  * our channel.
  *
- * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
+ * Default value: [`BREAKDOWN_TIMEOUT`] (currently 144), we enforce it as a minimum at channel
  * opening so you can tweak config to ask for more security, not less.
  */
 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
@@ -6265,10 +6274,6 @@ void ChainMonitor_free(struct LDKChainMonitor this_obj);
  * calls must not exclude any transactions matching the new outputs nor any in-block
  * descendants of such transactions. It is not necessary to re-fetch the block to obtain
  * updated `txdata`.
- *
- * [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
- * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
- * [`chain::Filter`]: ../trait.Filter.html
  */
 void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
 
@@ -6276,8 +6281,6 @@ void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this
  * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
  * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
  * details.
- *
- * [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
  */
 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
 
@@ -6289,8 +6292,6 @@ void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR t
  * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
  * always need to fetch full blocks absent another means for determining which blocks contain
  * transactions relevant to the watched channels.
- *
- * [`chain::Filter`]: ../trait.Filter.html
  */
 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
 
@@ -6323,8 +6324,6 @@ void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
  * The only instance where update_id values are not strictly increasing is the case where we
  * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
  * its docs for more details.
- *
- * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
  */
 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
 
@@ -6340,8 +6339,6 @@ uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate
  * The only instance where update_id values are not strictly increasing is the case where we
  * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
  * its docs for more details.
- *
- * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
  */
 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
 
@@ -6450,8 +6447,6 @@ void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNUL
 /**
  * Get the list of HTLCs who's status has been updated on chain. This should be called by
  * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
- *
- * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
  */
 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
 
@@ -8917,12 +8912,26 @@ uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *N
 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
 
 /**
- * The number of blocks to subtract from incoming HTLC cltv_expiry values
+ * The number of blocks such that if:
+ * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+ * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
+ * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
+ * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
+ * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
+ * forwarding. Note that the HTLC sender is the one who originally sets this value when
+ * constructing the route.
  */
 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
 
 /**
- * The number of blocks to subtract from incoming HTLC cltv_expiry values
+ * The number of blocks such that if:
+ * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+ * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
+ * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
+ * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
+ * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
+ * forwarding. Note that the HTLC sender is the one who originally sets this value when
+ * constructing the route.
  */
 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
 
@@ -9613,6 +9622,11 @@ struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_re
  */
 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
 
+/**
+ *\n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t
+ */
+MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
+
 /**
  * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
  */
@@ -10622,9 +10636,7 @@ void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
 
 /**
- * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
- *
- * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ * Creates a Features with the bits set which are known by the implementation
  */
 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
 
@@ -10634,9 +10646,7 @@ MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
 
 /**
- * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
- *
- * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ * Creates a Features with the bits set which are known by the implementation
  */
 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
 
@@ -10646,9 +10656,7 @@ MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
 
 /**
- * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
- *
- * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ * Creates a Features with the bits set which are known by the implementation
  */
 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
 
@@ -10658,9 +10666,7 @@ MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
 
 /**
- * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
- *
- * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ * Creates a Features with the bits set which are known by the implementation
  */
 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
 
index 032bd554e222a36a3f2f371854ef17c8bc7cb2f8..f14123df9a6844068b56bdecfe4bc31a9cd266eb 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Traits and utility impls which allow other parts of rust-lightning to interact with the
 //! blockchain.
 //!
index 3039ec6fa2b9f6fa8c7600149fa0db5d50a7b21e..55c18d340022a74a5f8b4716983ab723ab12f60a 100644 (file)
@@ -1,24 +1,26 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Logic to connect off-chain channel management with on-chain transaction monitoring.
 //!
 //! [`ChainMonitor`] is an implementation of [`chain::Watch`] used both to process blocks and to
 //! update [`ChannelMonitor`]s accordingly. If any on-chain events need further processing, it will
 //! make those available as [`MonitorEvent`]s to be consumed.
 //!
-//! `ChainMonitor` is parameterized by an optional chain source, which must implement the
+//! [`ChainMonitor`] is parameterized by an optional chain source, which must implement the
 //! [`chain::Filter`] trait. This provides a mechanism to signal new relevant outputs back to light
 //! clients, such that transactions spending those outputs are included in block data.
 //!
-//! `ChainMonitor` may be used directly to monitor channels locally or as a part of a distributed
-//! setup to monitor channels remotely. In the latter case, a custom `chain::Watch` implementation
+//! [`ChainMonitor`] may be used directly to monitor channels locally or as a part of a distributed
+//! setup to monitor channels remotely. In the latter case, a custom [`chain::Watch`] implementation
 //! would be responsible for routing each update to a remote server and for retrieving monitor
-//! events. The remote server would make use of `ChainMonitor` for block processing and for
-//! servicing `ChannelMonitor` updates from the client.
-//!
-//! [`ChainMonitor`]: struct.ChainMonitor.html
-//! [`chain::Filter`]: ../trait.Filter.html
-//! [`chain::Watch`]: ../trait.Watch.html
-//! [`ChannelMonitor`]: ../channelmonitor/struct.ChannelMonitor.html
-//! [`MonitorEvent`]: ../channelmonitor/enum.MonitorEvent.html
+//! events. The remote server would make use of [`ChainMonitor`] for block processing and for
+//! servicing [`ChannelMonitor`] updates from the client.
 
 use std::ffi::c_void;
 use bitcoin::hashes::Hash;
@@ -35,9 +37,8 @@ type nativeChainMonitor = nativeChainMonitorImport<crate::chain::keysinterface::
 /// or used independently to monitor channels remotely. See the [module-level documentation] for
 /// details.
 ///
-/// [`chain::Watch`]: ../trait.Watch.html
-/// [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
-/// [module-level documentation]: index.html
+/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+/// [module-level documentation]: crate::chain::chainmonitor
 #[must_use]
 #[repr(C)]
 pub struct ChainMonitor {
@@ -87,10 +88,6 @@ impl ChainMonitor {
 /// calls must not exclude any transactions matching the new outputs nor any in-block
 /// descendants of such transactions. It is not necessary to re-fetch the block to obtain
 /// updated `txdata`.
-///
-/// [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
-/// [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
-/// [`chain::Filter`]: ../trait.Filter.html
 #[no_mangle]
 pub extern "C" fn ChainMonitor_block_connected(this_arg: &ChainMonitor, header: *const [u8; 80], mut txdata: crate::c_types::derived::CVec_C2Tuple_usizeTransactionZZ, mut height: u32) {
        let mut local_txdata = Vec::new(); for mut item in txdata.into_rust().drain(..) { local_txdata.push( { let (mut orig_txdata_0_0, mut orig_txdata_0_1) = item.to_rust(); let mut local_txdata_0 = (orig_txdata_0_0, orig_txdata_0_1.into_bitcoin()); local_txdata_0 }); };
@@ -100,8 +97,6 @@ pub extern "C" fn ChainMonitor_block_connected(this_arg: &ChainMonitor, header:
 /// Dispatches to per-channel monitors, which are responsible for updating their on-chain view
 /// of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
 /// details.
-///
-/// [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
 #[no_mangle]
 pub extern "C" fn ChainMonitor_block_disconnected(this_arg: &ChainMonitor, header: *const [u8; 80], mut disconnected_height: u32) {
        unsafe { &*this_arg.inner }.block_disconnected(&::bitcoin::consensus::encode::deserialize(unsafe { &*header }).unwrap(), disconnected_height)
@@ -114,8 +109,6 @@ pub extern "C" fn ChainMonitor_block_disconnected(this_arg: &ChainMonitor, heade
 /// pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
 /// always need to fetch full blocks absent another means for determining which blocks contain
 /// transactions relevant to the watched channels.
-///
-/// [`chain::Filter`]: ../trait.Filter.html
 #[must_use]
 #[no_mangle]
 pub extern "C" fn ChainMonitor_new(chain_source: *mut crate::chain::Filter, mut broadcaster: crate::chain::chaininterface::BroadcasterInterface, mut logger: crate::util::logger::Logger, mut feeest: crate::chain::chaininterface::FeeEstimator, mut persister: crate::chain::channelmonitor::Persist) -> ChainMonitor {
index 67880d4f56a1277676c3117989174e47688312df..5e10158b9fb7f23587c03f6e218952cc5ed9a2ba 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! The logic to monitor for on-chain transactions and create the relevant claim responses lives
 //! here.
 //!
@@ -10,8 +18,6 @@
 //! ChannelMonitors should do so). Thus, if you're building rust-lightning into an HSM or other
 //! security-domain-separated system design, you should consider having multiple paths for
 //! ChannelMonitors to get out of the HSM and onto monitoring devices.
-//!
-//! [`chain::Watch`]: ../trait.Watch.html
 
 use std::ffi::c_void;
 use bitcoin::hashes::Hash;
@@ -74,8 +80,6 @@ impl ChannelMonitorUpdate {
 /// The only instance where update_id values are not strictly increasing is the case where we
 /// allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
 /// its docs for more details.
-///
-/// [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
 #[no_mangle]
 pub extern "C" fn ChannelMonitorUpdate_get_update_id(this_ptr: &ChannelMonitorUpdate) -> u64 {
        let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.update_id;
@@ -92,8 +96,6 @@ pub extern "C" fn ChannelMonitorUpdate_get_update_id(this_ptr: &ChannelMonitorUp
 /// The only instance where update_id values are not strictly increasing is the case where we
 /// allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
 /// its docs for more details.
-///
-/// [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
 #[no_mangle]
 pub extern "C" fn ChannelMonitorUpdate_set_update_id(this_ptr: &mut ChannelMonitorUpdate, mut val: u64) {
        unsafe { &mut *this_ptr.inner }.update_id = val;
@@ -401,8 +403,6 @@ type nativeHTLCUpdate = nativeHTLCUpdateImport;
 /// Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
 /// chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
 /// preimage claim backward will lead to loss of funds.
-///
-/// [`chain::Watch`]: ../trait.Watch.html
 #[must_use]
 #[repr(C)]
 pub struct HTLCUpdate {
@@ -597,8 +597,6 @@ pub extern "C" fn ChannelMonitor_load_outputs_to_watch(this_arg: &ChannelMonitor
 
 /// Get the list of HTLCs who's status has been updated on chain. This should be called by
 /// ChannelManager via [`chain::Watch::release_pending_monitor_events`].
-///
-/// [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
 #[must_use]
 #[no_mangle]
 pub extern "C" fn ChannelMonitor_get_and_clear_pending_monitor_events(this_arg: &ChannelMonitor) -> crate::c_types::derived::CVec_MonitorEventZ {
@@ -687,11 +685,8 @@ pub struct Persist {
        /// stored channel data). Note that you **must** persist every new monitor to
        /// disk. See the `Persist` trait documentation for more details.
        ///
-       /// See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+       /// See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
        /// and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
-       ///
-       /// [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
-       /// [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
        #[must_use]
        pub persist_new_channel: extern "C" fn (this_arg: *const c_void, id: crate::chain::transaction::OutPoint, data: &crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ,
        /// Update one channel's data. The provided `ChannelMonitor` has already
@@ -713,14 +708,9 @@ pub struct Persist {
        /// them in batches. The size of each monitor grows `O(number of state updates)`
        /// whereas updates are small and `O(1)`.
        ///
-       /// See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+       /// See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
        /// [`ChannelMonitorUpdate::write`] for writing out an update, and
        /// [`ChannelMonitorUpdateErr`] for requirements when returning errors.
-       ///
-       /// [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1
-       /// [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
-       /// [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write
-       /// [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
        #[must_use]
        pub update_persisted_channel: extern "C" fn (this_arg: *const c_void, id: crate::chain::transaction::OutPoint, update: &crate::chain::channelmonitor::ChannelMonitorUpdate, data: &crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ,
        /// Frees any resources associated with this object given its this_arg pointer.
index ae533b6eca2c948f4a898efa6fd5a89a44795afa..daa76b78ace8c752ecb57fe92c2e97455dae6be0 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! keysinterface provides keys into rust-lightning and defines some useful enums which describe
 //! spendable on-chain outputs which the user owns and is responsible for using just as any other
 //! on-chain output which is theirs.
index 1fe25100399d79a0132376f85928be403f55dd94..bce29715f7c16ae2764226dcfb66933e33c3c90d 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Structs and traits which allow other parts of rust-lightning to interact with the blockchain.
 
 use std::ffi::c_void;
@@ -10,8 +18,6 @@ pub mod channelmonitor;
 pub mod transaction;
 pub mod keysinterface;
 /// An error when accessing the chain via [`Access`].
-///
-/// [`Access`]: trait.Access.html
 #[must_use]
 #[derive(Clone)]
 #[repr(C)]
@@ -171,9 +177,9 @@ impl Drop for Listen {
 /// funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
 /// multiple instances.
 ///
-/// [`ChannelMonitor`]: channelmonitor/struct.ChannelMonitor.html
-/// [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
-/// [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure
+/// [`ChannelMonitor`]: channelmonitor::ChannelMonitor
+/// [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
+/// [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
 #[repr(C)]
 pub struct Watch {
        /// An opaque pointer which is passed to your function implementations as an argument.
@@ -185,9 +191,9 @@ pub struct Watch {
        /// with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
        /// calling [`block_connected`] and [`block_disconnected`] on the monitor.
        ///
-       /// [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch
-       /// [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected
-       /// [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
+       /// [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
+       /// [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
+       /// [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
        #[must_use]
        pub watch_channel: extern "C" fn (this_arg: *const c_void, funding_txo: crate::chain::transaction::OutPoint, monitor: crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ,
        /// Updates a channel identified by `funding_txo` by applying `update` to its monitor.
@@ -195,8 +201,8 @@ pub struct Watch {
        /// Implementations must call [`update_monitor`] with the given update. See
        /// [`ChannelMonitorUpdateErr`] for invariants around returning an error.
        ///
-       /// [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor
-       /// [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
+       /// [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
+       /// [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
        #[must_use]
        pub update_channel: extern "C" fn (this_arg: *const c_void, funding_txo: crate::chain::transaction::OutPoint, update: crate::chain::channelmonitor::ChannelMonitorUpdate) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ,
        /// Returns any monitor events since the last call. Subsequent calls must only return new
@@ -261,11 +267,10 @@ impl Drop for Watch {
 ///
 /// Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
 /// should not block on I/O. Implementations should instead queue the newly monitored data to be
-/// processed later. Then, in order to block until the data has been processed, any `Watch`
+/// processed later. Then, in order to block until the data has been processed, any [`Watch`]
 /// invocation that has called the `Filter` must return [`TemporaryFailure`].
 ///
-/// [`Watch`]: trait.Watch.html
-/// [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure
+/// [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
 /// [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
 /// [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
 #[repr(C)]
index 00798734a7e48517d379d747776750e9e1fc57d9..cf9fdeee9cdc8b98a7e37b6437f3468f0fddc5a9 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Types describing on-chain transactions.
 
 use std::ffi::c_void;
index 044c3288d8cc13fd8392330ff7bca4ecbf53d3c2..848464e9a06ccecda1778148848093b3b36b1f8b 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //!lightning
 //! Rust-Lightning, not Rusty's Lightning!
 //!
index f2a2a5abf5a8228ba36967d73b1e8c5ed0fd01da..406c4d1cb504c71c1fcacc99c252b317a6fdafa4 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Various utilities for building scripts and deriving keys related to channels. These are
 //! largely of interest for those implementing chain::keysinterface::Sign message signing by hand.
 
index 502520a4156fea0db4484c2344782ca300935e39..a5551a643bccef036b93a6b5de4a7f1761ca5dfa 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! The top-level channel management and payment tracking stuff lives here.
 //!
 //! The ChannelManager is the main chunk of logic implementing the lightning protocol and is
@@ -189,6 +197,15 @@ pub extern "C" fn ChainParameters_new(mut network_arg: crate::bitcoin::network::
                latest_height: latest_height_arg,
        })), is_owned: true }
 }
+/// The amount of time in blocks we require our counterparty wait to claim their money (ie time
+/// between when we, or our watchtower, must check for them having broadcast a theft transaction).
+///
+/// This can be increased (but not decreased) through [`ChannelHandshakeConfig::our_to_self_delay`]
+///
+/// [`ChannelHandshakeConfig::our_to_self_delay`]: crate::util::config::ChannelHandshakeConfig::our_to_self_delay
+
+#[no_mangle]
+pub static BREAKDOWN_TIMEOUT: u16 = lightning::ln::channelmanager::BREAKDOWN_TIMEOUT;
 
 use lightning::ln::channelmanager::ChannelDetails as nativeChannelDetailsImport;
 type nativeChannelDetails = nativeChannelDetailsImport;
@@ -943,6 +960,7 @@ pub extern "C" fn ChannelManager_as_ChannelMessageHandler(this_arg: &ChannelMana
                peer_disconnected: ChannelManager_ChannelMessageHandler_peer_disconnected,
                peer_connected: ChannelManager_ChannelMessageHandler_peer_connected,
                handle_channel_reestablish: ChannelManager_ChannelMessageHandler_handle_channel_reestablish,
+               handle_channel_update: ChannelManager_ChannelMessageHandler_handle_channel_update,
                handle_error: ChannelManager_ChannelMessageHandler_handle_error,
                MessageSendEventsProvider: crate::util::events::MessageSendEventsProvider {
                        this_arg: unsafe { (*this_arg).inner as *mut c_void },
@@ -997,6 +1015,9 @@ extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_fee(this_arg: *
 extern "C" fn ChannelManager_ChannelMessageHandler_handle_announcement_signatures(this_arg: *const c_void, mut counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::AnnouncementSignatures) {
        <nativeChannelManager as lightning::ln::msgs::ChannelMessageHandler<>>::handle_announcement_signatures(unsafe { &mut *(this_arg as *mut nativeChannelManager) }, &counterparty_node_id.into_rust(), unsafe { &*msg.inner })
 }
+extern "C" fn ChannelManager_ChannelMessageHandler_handle_channel_update(this_arg: *const c_void, mut counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ChannelUpdate) {
+       <nativeChannelManager as lightning::ln::msgs::ChannelMessageHandler<>>::handle_channel_update(unsafe { &mut *(this_arg as *mut nativeChannelManager) }, &counterparty_node_id.into_rust(), unsafe { &*msg.inner })
+}
 extern "C" fn ChannelManager_ChannelMessageHandler_handle_channel_reestablish(this_arg: *const c_void, mut counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ChannelReestablish) {
        <nativeChannelManager as lightning::ln::msgs::ChannelMessageHandler<>>::handle_channel_reestablish(unsafe { &mut *(this_arg as *mut nativeChannelManager) }, &counterparty_node_id.into_rust(), unsafe { &*msg.inner })
 }
index 1866068440f7fbdaf3558b09955c169ffe2fcd55..a58ae7a6aa158b50f63555da065f739dcbbc433c 100644 (file)
@@ -1,10 +1,17 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Feature flag definitions for the Lightning protocol according to [BOLT #9].
 //!
 //! Lightning nodes advertise a supported set of operation through feature flags. Features are
 //! applicable for a specific context as indicated in some [messages]. [`Features`] encapsulates
 //! behavior for specifying and checking feature flags for a particular context. Each feature is
-//! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits). A
-//! [`Context`] is used to parameterize [`Features`] and defines which features it can support.
+//! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits).
 //!
 //! Whether a feature is considered \"known\" or \"unknown\" is relative to the implementation, whereas
 //! the term \"supports\" is used in reference to a particular set of [`Features`]. That is, a node
@@ -12,9 +19,7 @@
 //! And the implementation can interpret a feature if the feature is known to it.
 //!
 //! [BOLT #9]: https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md
-//! [messages]: ../msgs/index.html
-//! [`Features`]: struct.Features.html
-//! [`Context`]: sealed/trait.Context.html
+//! [messages]: crate::ln::msgs
 
 use std::ffi::c_void;
 use bitcoin::hashes::Hash;
@@ -284,9 +289,7 @@ pub extern "C" fn InitFeatures_empty() -> InitFeatures {
        InitFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true }
 }
 
-/// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
-///
-/// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+/// Creates a Features with the bits set which are known by the implementation
 #[must_use]
 #[no_mangle]
 pub extern "C" fn InitFeatures_known() -> InitFeatures {
@@ -302,9 +305,7 @@ pub extern "C" fn NodeFeatures_empty() -> NodeFeatures {
        NodeFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true }
 }
 
-/// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
-///
-/// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+/// Creates a Features with the bits set which are known by the implementation
 #[must_use]
 #[no_mangle]
 pub extern "C" fn NodeFeatures_known() -> NodeFeatures {
@@ -320,9 +321,7 @@ pub extern "C" fn ChannelFeatures_empty() -> ChannelFeatures {
        ChannelFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true }
 }
 
-/// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
-///
-/// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+/// Creates a Features with the bits set which are known by the implementation
 #[must_use]
 #[no_mangle]
 pub extern "C" fn ChannelFeatures_known() -> ChannelFeatures {
@@ -338,9 +337,7 @@ pub extern "C" fn InvoiceFeatures_empty() -> InvoiceFeatures {
        InvoiceFeatures { inner: Box::into_raw(Box::new(ret)), is_owned: true }
 }
 
-/// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
-///
-/// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+/// Creates a Features with the bits set which are known by the implementation
 #[must_use]
 #[no_mangle]
 pub extern "C" fn InvoiceFeatures_known() -> InvoiceFeatures {
index b81204a4720322bbfbb39a3caef304ac555a8e68..d6ca8b38a7cd641f831bb679176bf1c83ba92a09 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! High level lightning structs and impls live here.
 //!
 //! You probably want to create a channelmanager::ChannelManager, and a routing::NetGraphMsgHandler first.
index 4eb5b9d22dbd463870151486ae1ea073494c8448..5f32cacfbaeb0ccd371a6209f05a4c91ce689c16 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Wire messages, traits representing wire message handlers, and a few error types live here.
 //!
 //! For a normal node you probably don't need to use anything here, however, if you wish to split a
@@ -3264,13 +3272,27 @@ pub extern "C" fn UnsignedChannelUpdate_get_flags(this_ptr: &UnsignedChannelUpda
 pub extern "C" fn UnsignedChannelUpdate_set_flags(this_ptr: &mut UnsignedChannelUpdate, mut val: u8) {
        unsafe { &mut *this_ptr.inner }.flags = val;
 }
-/// The number of blocks to subtract from incoming HTLC cltv_expiry values
+/// The number of blocks such that if:
+/// `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+/// then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
+/// the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
+/// cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
+/// then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
+/// forwarding. Note that the HTLC sender is the one who originally sets this value when
+/// constructing the route.
 #[no_mangle]
 pub extern "C" fn UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr: &UnsignedChannelUpdate) -> u16 {
        let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.cltv_expiry_delta;
        (*inner_val)
 }
-/// The number of blocks to subtract from incoming HTLC cltv_expiry values
+/// The number of blocks such that if:
+/// `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+/// then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
+/// the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
+/// cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
+/// then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
+/// forwarding. Note that the HTLC sender is the one who originally sets this value when
+/// constructing the route.
 #[no_mangle]
 pub extern "C" fn UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr: &mut UnsignedChannelUpdate, mut val: u16) {
        unsafe { &mut *this_ptr.inner }.cltv_expiry_delta = val;
@@ -4486,6 +4508,8 @@ pub struct ChannelMessageHandler {
        pub peer_connected: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::Init),
        /// Handle an incoming channel_reestablish message from the given peer.
        pub handle_channel_reestablish: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ChannelReestablish),
+       /// Handle an incoming channel update from the given peer.
+       pub handle_channel_update: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ChannelUpdate),
        /// Handle an incoming error message from the given peer.
        pub handle_error: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ErrorMessage),
 /// Implementation of MessageSendEventsProvider for this object.
@@ -4558,6 +4582,9 @@ impl rustChannelMessageHandler for ChannelMessageHandler {
        fn handle_channel_reestablish(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::ChannelReestablish) {
                (self.handle_channel_reestablish)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::ln::msgs::ChannelReestablish { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
        }
+       fn handle_channel_update(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::ChannelUpdate) {
+               (self.handle_channel_update)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::ln::msgs::ChannelUpdate { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
+       }
        fn handle_error(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::ErrorMessage) {
                (self.handle_error)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::ln::msgs::ErrorMessage { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
        }
@@ -5177,6 +5204,14 @@ pub extern "C" fn ReplyShortChannelIdsEnd_write(obj: &ReplyShortChannelIdsEnd) -
 pub(crate) extern "C" fn ReplyShortChannelIdsEnd_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeReplyShortChannelIdsEnd) })
 }
+///\n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t 
+#[must_use]
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_end_blocknum(this_arg: &QueryChannelRange) -> u32 {
+       let mut ret = unsafe { &*this_arg.inner }.end_blocknum();
+       ret
+}
+
 #[no_mangle]
 /// Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
 pub extern "C" fn QueryChannelRange_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_QueryChannelRangeDecodeErrorZ {
index 9cf6baa349a8618cc522901fdd1b36cea79706df..9f3f8409cfc9484da166c1abb6ae0b45487621a7 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Top level peer message handling and socket handling logic lives here.
 //!
 //! Instead of actually servicing sockets ourselves we require that you implement the
@@ -312,6 +320,7 @@ pub extern "C" fn ErroringMessageHandler_as_ChannelMessageHandler(this_arg: &Err
                peer_disconnected: ErroringMessageHandler_ChannelMessageHandler_peer_disconnected,
                peer_connected: ErroringMessageHandler_ChannelMessageHandler_peer_connected,
                handle_channel_reestablish: ErroringMessageHandler_ChannelMessageHandler_handle_channel_reestablish,
+               handle_channel_update: ErroringMessageHandler_ChannelMessageHandler_handle_channel_update,
                handle_error: ErroringMessageHandler_ChannelMessageHandler_handle_error,
                MessageSendEventsProvider: crate::util::events::MessageSendEventsProvider {
                        this_arg: unsafe { (*this_arg).inner as *mut c_void },
@@ -369,6 +378,9 @@ extern "C" fn ErroringMessageHandler_ChannelMessageHandler_handle_announcement_s
 extern "C" fn ErroringMessageHandler_ChannelMessageHandler_handle_channel_reestablish(this_arg: *const c_void, mut their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ChannelReestablish) {
        <nativeErroringMessageHandler as lightning::ln::msgs::ChannelMessageHandler<>>::handle_channel_reestablish(unsafe { &mut *(this_arg as *mut nativeErroringMessageHandler) }, &their_node_id.into_rust(), unsafe { &*msg.inner })
 }
+extern "C" fn ErroringMessageHandler_ChannelMessageHandler_handle_channel_update(this_arg: *const c_void, mut _their_node_id: crate::c_types::PublicKey, _msg: &crate::ln::msgs::ChannelUpdate) {
+       <nativeErroringMessageHandler as lightning::ln::msgs::ChannelMessageHandler<>>::handle_channel_update(unsafe { &mut *(this_arg as *mut nativeErroringMessageHandler) }, &_their_node_id.into_rust(), unsafe { &*_msg.inner })
+}
 extern "C" fn ErroringMessageHandler_ChannelMessageHandler_peer_disconnected(this_arg: *const c_void, mut _their_node_id: crate::c_types::PublicKey, mut _no_connection_possible: bool) {
        <nativeErroringMessageHandler as lightning::ln::msgs::ChannelMessageHandler<>>::peer_disconnected(unsafe { &mut *(this_arg as *mut nativeErroringMessageHandler) }, &_their_node_id.into_rust(), _no_connection_possible)
 }
index 4311ff3538ac30e65b217d953e752f565b88b1e3..a06e1d09ad191cadca6da01c118a213372cb96d4 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Structs and impls for receiving messages about the network and storing the topology live here.
 
 use std::ffi::c_void;
index f4eec9db115b6ab42a1e56877e48a4b0e9b0a348..9ffeaf287f2afd9f9b4aa5ee21d4e6c1bc95183d 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! The top-level network map tracking logic lives here.
 
 use std::ffi::c_void;
@@ -301,8 +309,8 @@ extern "C" fn NetGraphMsgHandler_RoutingMessageHandler_handle_reply_short_channe
        local_ret
 }
 #[must_use]
-extern "C" fn NetGraphMsgHandler_RoutingMessageHandler_handle_query_channel_range(this_arg: *const c_void, mut _their_node_id: crate::c_types::PublicKey, mut _msg: crate::ln::msgs::QueryChannelRange) -> crate::c_types::derived::CResult_NoneLightningErrorZ {
-       let mut ret = <nativeNetGraphMsgHandler as lightning::ln::msgs::RoutingMessageHandler<>>::handle_query_channel_range(unsafe { &mut *(this_arg as *mut nativeNetGraphMsgHandler) }, &_their_node_id.into_rust(), *unsafe { Box::from_raw(_msg.take_inner()) });
+extern "C" fn NetGraphMsgHandler_RoutingMessageHandler_handle_query_channel_range(this_arg: *const c_void, mut their_node_id: crate::c_types::PublicKey, mut msg: crate::ln::msgs::QueryChannelRange) -> crate::c_types::derived::CResult_NoneLightningErrorZ {
+       let mut ret = <nativeNetGraphMsgHandler as lightning::ln::msgs::RoutingMessageHandler<>>::handle_query_channel_range(unsafe { &mut *(this_arg as *mut nativeNetGraphMsgHandler) }, &their_node_id.into_rust(), *unsafe { Box::from_raw(msg.take_inner()) });
        let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { 0u8 /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::LightningError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
        local_ret
 }
index 496781fae070a7beb8895222d18028451eebbde6..c07ab519a6fd0608591341bf5afb684cacf90b03 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! The top-level routing/network map tracking logic lives here.
 //!
 //! You probably want to create a NetGraphMsgHandler and use that as your RoutingMessageHandler and then
index a680d5c0e406bdc47bae44f1b482f62bc72b4802..d1d3f1bdbd732e7e54e30e9b66ae25c2c4343b42 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Various user-configurable channel limits and settings which ChannelManager
 //! applies for you.
 
@@ -81,7 +89,7 @@ pub extern "C" fn ChannelHandshakeConfig_set_minimum_depth(this_ptr: &mut Channe
 /// case of an honest unilateral channel close, which implicitly decrease the economic value of
 /// our channel.
 ///
-/// Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
+/// Default value: [`BREAKDOWN_TIMEOUT`] (currently 144), we enforce it as a minimum at channel
 /// opening so you can tweak config to ask for more security, not less.
 #[no_mangle]
 pub extern "C" fn ChannelHandshakeConfig_get_our_to_self_delay(this_ptr: &ChannelHandshakeConfig) -> u16 {
@@ -98,7 +106,7 @@ pub extern "C" fn ChannelHandshakeConfig_get_our_to_self_delay(this_ptr: &Channe
 /// case of an honest unilateral channel close, which implicitly decrease the economic value of
 /// our channel.
 ///
-/// Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
+/// Default value: [`BREAKDOWN_TIMEOUT`] (currently 144), we enforce it as a minimum at channel
 /// opening so you can tweak config to ask for more security, not less.
 #[no_mangle]
 pub extern "C" fn ChannelHandshakeConfig_set_our_to_self_delay(this_ptr: &mut ChannelHandshakeConfig, mut val: u16) {
index d24df67e366d0568e15751ca766a182c5cba6dbb..526138297a7b1e7e38828c386591aa95ed14f49b 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Error types live here.
 
 use std::ffi::c_void;
index 905360b821b8d49267bbb8f448041a8f35537e3e..72d9de5e899bdc2d6d5a8c42ce564e8f3b72dc78 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Events are returned from various bits in the library which indicate some action must be taken
 //! by the client.
 //!
@@ -491,6 +499,14 @@ pub enum MessageSendEvent {
                /// The query_short_channel_ids which should be sent.
                msg: crate::ln::msgs::QueryShortChannelIds,
        },
+       /// Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
+       /// emitted during processing of the query.
+       SendReplyChannelRange {
+               /// The node_id of this message recipient
+               node_id: crate::c_types::PublicKey,
+               /// The reply_channel_range which should be sent.
+               msg: crate::ln::msgs::ReplyChannelRange,
+       },
 }
 use lightning::util::events::MessageSendEvent as nativeMessageSendEvent;
 impl MessageSendEvent {
@@ -635,6 +651,14 @@ impl MessageSendEvent {
                                        msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
                                }
                        },
+                       MessageSendEvent::SendReplyChannelRange {ref node_id, ref msg, } => {
+                               let mut node_id_nonref = (*node_id).clone();
+                               let mut msg_nonref = (*msg).clone();
+                               nativeMessageSendEvent::SendReplyChannelRange {
+                                       node_id: node_id_nonref.into_rust(),
+                                       msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
+                               }
+                       },
                }
        }
        #[allow(unused)]
@@ -745,6 +769,12 @@ impl MessageSendEvent {
                                        msg: *unsafe { Box::from_raw(msg.take_inner()) },
                                }
                        },
+                       MessageSendEvent::SendReplyChannelRange {mut node_id, mut msg, } => {
+                               nativeMessageSendEvent::SendReplyChannelRange {
+                                       node_id: node_id.into_rust(),
+                                       msg: *unsafe { Box::from_raw(msg.take_inner()) },
+                               }
+                       },
                }
        }
        #[allow(unused)]
@@ -888,6 +918,14 @@ impl MessageSendEvent {
                                        msg: crate::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(msg_nonref)), is_owned: true },
                                }
                        },
+                       nativeMessageSendEvent::SendReplyChannelRange {ref node_id, ref msg, } => {
+                               let mut node_id_nonref = (*node_id).clone();
+                               let mut msg_nonref = (*msg).clone();
+                               MessageSendEvent::SendReplyChannelRange {
+                                       node_id: crate::c_types::PublicKey::from_rust(&node_id_nonref),
+                                       msg: crate::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(msg_nonref)), is_owned: true },
+                               }
+                       },
                }
        }
        #[allow(unused)]
@@ -998,6 +1036,12 @@ impl MessageSendEvent {
                                        msg: crate::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(msg)), is_owned: true },
                                }
                        },
+                       nativeMessageSendEvent::SendReplyChannelRange {mut node_id, mut msg, } => {
+                               MessageSendEvent::SendReplyChannelRange {
+                                       node_id: crate::c_types::PublicKey::from_rust(&node_id),
+                                       msg: crate::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(msg)), is_owned: true },
+                               }
+                       },
                }
        }
 }
index 97874ddf84815c1f6e94964c59993c084501d60b..e6b98de5b09a7688dda308cdcc2e5141e996025c 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Log traits live here, which are called throughout the library to provide useful information for
 //! debugging purposes.
 //!
index c35bf641a53dcd32c033d731c38920c07120f64e..49003dc7762ecde6b5f7c59f96a2da24e11467bd 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! Some utility modules live here. See individual sub-modules for more info.
 
 use std::ffi::c_void;
index b088e963f4a236bf7e10287f84ae49d8ef70ad45..e0c561f6504583cbc69805072000732cb4abd918 100644 (file)
@@ -1,3 +1,11 @@
+// This file is Copyright its original authors, visible in version control
+// history and in the source files from which this was generated.
+//
+// This file is licensed under the license available in the LICENSE or LICENSE.md
+// file in the root of this repository or, if no such file exists, the same
+// license as that which applies to the original source files from which this
+// source was automatically generated.
+
 //! A very simple serialization framework which is used to serialize/deserialize messages as well
 //! as ChannelsManagers and ChannelMonitors.