Merge pull request #51 from TheBlueMatt/main
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Mon, 20 Dec 2021 05:03:40 +0000 (05:03 +0000)
committerGitHub <noreply@github.com>
Mon, 20 Dec 2021 05:03:40 +0000 (05:03 +0000)
0.0.104 Bindings Updates

31 files changed:
.github/workflows/build.yml
c-bindings-gen/src/blocks.rs
c-bindings-gen/src/types.rs
genbindings.sh
lightning-c-bindings/Cargo.toml
lightning-c-bindings/demo.cpp
lightning-c-bindings/include/ldk_rust_types.h
lightning-c-bindings/include/lightning.h
lightning-c-bindings/include/lightningpp.hpp
lightning-c-bindings/src/c_types/derived.rs
lightning-c-bindings/src/c_types/mod.rs
lightning-c-bindings/src/lightning/chain/chaininterface.rs
lightning-c-bindings/src/lightning/chain/channelmonitor.rs
lightning-c-bindings/src/lightning/chain/keysinterface.rs
lightning-c-bindings/src/lightning/ln/chan_utils.rs
lightning-c-bindings/src/lightning/ln/channelmanager.rs
lightning-c-bindings/src/lightning/ln/features.rs
lightning-c-bindings/src/lightning/ln/msgs.rs
lightning-c-bindings/src/lightning/ln/script.rs
lightning-c-bindings/src/lightning/routing/mod.rs
lightning-c-bindings/src/lightning/routing/network_graph.rs
lightning-c-bindings/src/lightning/routing/router.rs
lightning-c-bindings/src/lightning/routing/scorer.rs [deleted file]
lightning-c-bindings/src/lightning/routing/scoring.rs [new file with mode: 0644]
lightning-c-bindings/src/lightning/util/config.rs
lightning-c-bindings/src/lightning/util/events.rs
lightning-c-bindings/src/lightning/util/logger.rs
lightning-c-bindings/src/lightning_background_processor.rs
lightning-c-bindings/src/lightning_invoice/mod.rs
lightning-c-bindings/src/lightning_invoice/payment.rs
lightning-c-bindings/src/lightning_invoice/utils.rs

index e7657d102a5afc15aba6782190d93cfbac5a53a8..64bc90c2e78e9c76225726c80eec59cb0068ce6a 100644 (file)
@@ -32,7 +32,7 @@ jobs:
         run: |
           git clone https://github.com/rust-bitcoin/rust-lightning
           cd rust-lightning
-          git checkout 0.0.103-bindings
+          git checkout 0.0.104-bindings
       - name: Rebuild bindings without std, and check the sample app builds + links
         run: ./genbindings.sh ./rust-lightning false
       - name: Rebuild bindings, and check the sample app builds + links
@@ -83,7 +83,7 @@ jobs:
         run: |
           git clone https://github.com/rust-bitcoin/rust-lightning
           cd rust-lightning
-          git checkout 0.0.103-bindings
+          git checkout 0.0.104-bindings
       - name: Rebuild bindings using Apple clang, and check the sample app builds + links
         run: ./genbindings.sh ./rust-lightning true
       - name: Rebuild bindings using upstream clang, and check the sample app builds + links
index 6e6b897e9c13ce9cd9b21fdda30cbbbf28870a39..b2f952be5fa1cb3fdcb6f51a6d677d7680f59d60 100644 (file)
@@ -346,27 +346,38 @@ pub fn write_option_block<W: std::io::Write>(w: &mut W, mangled_container: &str,
        writeln!(w, "/// An enum which can either contain a {} or not", inner_type).unwrap();
        writeln!(w, "pub enum {} {{", mangled_container).unwrap();
        writeln!(w, "\t/// When we're in this state, this {} contains a {}", mangled_container, inner_type).unwrap();
-       writeln!(w, "\tSome({}),", inner_type).unwrap();
+       if inner_type != "" {
+               writeln!(w, "\tSome({}),", inner_type).unwrap();
+       } else {
+               writeln!(w, "\tSome,").unwrap();
+       }
        writeln!(w, "\t/// When we're in this state, this {} contains nothing", mangled_container).unwrap();
        writeln!(w, "\tNone").unwrap();
        writeln!(w, "}}").unwrap();
 
        writeln!(w, "impl {} {{", mangled_container).unwrap();
        writeln!(w, "\t#[allow(unused)] pub(crate) fn is_some(&self) -> bool {{").unwrap();
-       writeln!(w, "\t\tif let Self::Some(_) = self {{ true }} else {{ false }}").unwrap();
+       writeln!(w, "\t\tif let Self::None = self {{ false }} else {{ true }}").unwrap();
        writeln!(w, "\t}}").unwrap();
        writeln!(w, "\t#[allow(unused)] pub(crate) fn is_none(&self) -> bool {{").unwrap();
        writeln!(w, "\t\t!self.is_some()").unwrap();
        writeln!(w, "\t}}").unwrap();
-       writeln!(w, "\t#[allow(unused)] pub(crate) fn take(mut self) -> {} {{", inner_type).unwrap();
-       writeln!(w, "\t\tif let Self::Some(v) = self {{ v }} else {{ unreachable!() }}").unwrap();
-       writeln!(w, "\t}}").unwrap();
+       if inner_type != "" {
+               writeln!(w, "\t#[allow(unused)] pub(crate) fn take(mut self) -> {} {{", inner_type).unwrap();
+               writeln!(w, "\t\tif let Self::Some(v) = self {{ v }} else {{ unreachable!() }}").unwrap();
+               writeln!(w, "\t}}").unwrap();
+       }
        writeln!(w, "}}").unwrap();
 
        writeln!(w, "#[no_mangle]").unwrap();
        writeln!(w, "/// Constructs a new {} containing a {}", mangled_container, inner_type).unwrap();
-       writeln!(w, "pub extern \"C\" fn {}_some(o: {}) -> {} {{", mangled_container, inner_type, mangled_container).unwrap();
-       writeln!(w, "\t{}::Some(o)", mangled_container).unwrap();
+       if inner_type != "" {
+               writeln!(w, "pub extern \"C\" fn {}_some(o: {}) -> {} {{", mangled_container, inner_type, mangled_container).unwrap();
+               writeln!(w, "\t{}::Some(o)", mangled_container).unwrap();
+       } else {
+               writeln!(w, "pub extern \"C\" fn {}_some() -> {} {{", mangled_container, mangled_container).unwrap();
+               writeln!(w, "\t{}::Some", mangled_container).unwrap();
+       }
        writeln!(w, "}}").unwrap();
 
        writeln!(w, "#[no_mangle]").unwrap();
index f5417010aeafa4aae98a5ba82b7d0ee9375a4924..0a6bce453e5628a4847c890e44c9ca0c49e5ac16 100644 (file)
@@ -874,7 +874,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
                        "[u8; 20]" if !is_ref => Some("crate::c_types::TwentyBytes"),
                        "[u8; 16]" if !is_ref => Some("crate::c_types::SixteenBytes"),
-                       "[u8; 10]" if !is_ref => Some("crate::c_types::TenBytes"),
+                       "[u8; 12]" if !is_ref => Some("crate::c_types::TwelveBytes"),
                        "[u8; 4]" if !is_ref => Some("crate::c_types::FourBytes"),
                        "[u8; 3]" if !is_ref => Some("crate::c_types::ThreeBytes"), // Used for RGB values
 
@@ -921,9 +921,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::hash_types::Txid"|"bitcoin::hash_types::BlockHash"|"bitcoin_hashes::sha256::Hash"
                                if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
                        "bitcoin::secp256k1::Message" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId"
+                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial"
                                if is_ref => Some("*const [u8; 32]"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId"
+                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial"
                                if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
 
                        "lightning::io::Read" => Some("crate::c_types::u8slice"),
@@ -949,7 +951,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if !is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some(""),
                        "[u8; 16]" if !is_ref => Some(""),
-                       "[u8; 10]" if !is_ref => Some(""),
+                       "[u8; 12]" if !is_ref => Some(""),
                        "[u8; 4]" if !is_ref => Some(""),
                        "[u8; 3]" if !is_ref => Some(""),
 
@@ -1011,6 +1013,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "lightning::ln::PaymentSecret" if !is_ref => Some("::lightning::ln::PaymentSecret("),
                        "lightning::ln::channelmanager::PaymentId" if !is_ref => Some("::lightning::ln::channelmanager::PaymentId("),
                        "lightning::ln::channelmanager::PaymentId" if is_ref=> Some("&::lightning::ln::channelmanager::PaymentId( unsafe { *"),
+                       "lightning::chain::keysinterface::KeyMaterial" if !is_ref => Some("::lightning::chain::keysinterface::KeyMaterial("),
+                       "lightning::chain::keysinterface::KeyMaterial" if is_ref=> Some("&::lightning::chain::keysinterface::KeyMaterial( unsafe { *"),
 
                        // List of traits we map (possibly during processing of other files):
                        "lightning::io::Read" => Some("&mut "),
@@ -1031,7 +1035,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if !is_ref => Some(".data"),
                        "[u8; 20]" if !is_ref => Some(".data"),
                        "[u8; 16]" if !is_ref => Some(".data"),
-                       "[u8; 10]" if !is_ref => Some(".data"),
+                       "[u8; 12]" if !is_ref => Some(".data"),
                        "[u8; 4]" if !is_ref => Some(".data"),
                        "[u8; 3]" if !is_ref => Some(".data"),
 
@@ -1075,9 +1079,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::hash_types::Txid" if is_ref => Some(" }[..]).unwrap()"),
                        "bitcoin::hash_types::Txid" => Some(".data[..]).unwrap()"),
                        "bitcoin::hash_types::BlockHash" if !is_ref => Some(".data[..]).unwrap()"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId"
+                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial"
                                if !is_ref => Some(".data)"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId"
+                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial"
                                if is_ref => Some(" })"),
 
                        // List of traits we map (possibly during processing of other files):
@@ -1115,7 +1121,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some("crate::c_types::TwentyBytes { data: "),
                        "[u8; 16]" if !is_ref => Some("crate::c_types::SixteenBytes { data: "),
-                       "[u8; 10]" if !is_ref => Some("crate::c_types::TenBytes { data: "),
+                       "[u8; 12]" if !is_ref => Some("crate::c_types::TwelveBytes { data: "),
                        "[u8; 4]" if !is_ref => Some("crate::c_types::FourBytes { data: "),
                        "[u8; 3]" if is_ref => Some(""),
 
@@ -1162,9 +1168,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::hash_types::Txid"|"bitcoin::hash_types::BlockHash"|"bitcoin_hashes::sha256::Hash"
                                if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
                        "bitcoin::secp256k1::Message" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId"
+                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial"
                                if is_ref => Some("&"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId"
+                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial"
                                if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
 
                        "lightning::io::Read" => Some("crate::c_types::u8slice::from_vec(&crate::c_types::reader_to_vec("),
@@ -1185,7 +1193,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "[u8; 32]" if is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some(" }"),
                        "[u8; 16]" if !is_ref => Some(" }"),
-                       "[u8; 10]" if !is_ref => Some(" }"),
+                       "[u8; 12]" if !is_ref => Some(" }"),
                        "[u8; 4]" if !is_ref => Some(" }"),
                        "[u8; 3]" if is_ref => Some(""),
 
@@ -1232,9 +1240,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::hash_types::Txid"|"bitcoin::hash_types::BlockHash"|"bitcoin_hashes::sha256::Hash"
                                if !is_ref => Some(".into_inner() }"),
                        "bitcoin::secp256k1::Message" if !is_ref => Some(".as_ref().clone() }"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId"
+                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial"
                                if is_ref => Some(".0"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId"
+                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial"
                                if !is_ref => Some(".0 }"),
 
                        "lightning::io::Read" => Some("))"),
@@ -1376,6 +1386,14 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                        }
                                }
                                if let Some(t) = single_contained {
+                                       if let syn::Type::Tuple(syn::TypeTuple { elems, .. }) = t {
+                                               assert!(elems.is_empty());
+                                               let inner_name = self.get_c_mangled_container_type(vec![single_contained.unwrap()], generics, "Option").unwrap();
+                                               return Some(("if ", vec![
+                                                       (format!(".is_none() {{ {}::None }} else {{ {}::Some /*",
+                                                               inner_name, inner_name), format!(""))
+                                                       ], " */}", ContainerPrefixLocation::PerConv));
+                                       }
                                        if let syn::Type::Reference(syn::TypeReference { elem, .. }) = t {
                                                if let syn::Type::Slice(_) = &**elem {
                                                        return Some(("if ", vec![
@@ -2383,7 +2401,13 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                }
                                if !self.write_c_type_intern(w, t, generics, false, false, false, false) { return false; }
                        } else {
-                               assert!(!is_ref); // We don't currently support outer reference types for non-primitive inners
+                               // We don't currently support outer reference types for non-primitive inners,
+                               // except for the empty tuple.
+                               if let syn::Type::Tuple(t_arg) = t {
+                                       assert!(t_arg.elems.len() == 0 || !is_ref);
+                               } else {
+                                       assert!(!is_ref);
+                               }
                                if !self.write_c_type_intern(w, t, generics, false, false, false, false) { return false; }
                        }
                }
index 8d4d72699955ee19d12b948b26643dbd31537857..20533598bbab65e78ebe5795bf51c48d21fdbcc1 100755 (executable)
@@ -158,11 +158,11 @@ function drop_crate() {
 
 echo > /tmp/crate-source.txt
 if [ "$2" = "true" ]; then
-       add_crate lightning lightning --features=allow_wallclock_use ', features = ["allow_wallclock_use"]'
+       add_crate lightning lightning --features=std ', features = ["std"]'
        add_crate "lightning-persister" "lightning_persister"
        add_crate "lightning-background-processor" "lightning_background_processor"
 else
-       add_crate lightning lightning
+       add_crate lightning lightning --features=no-std ', features = ["no-std"]'
        drop_crate "lightning-persister"
        drop_crate "lightning-background-processor"
 fi
@@ -279,29 +279,35 @@ gcc $LOCAL_CFLAGS -Wall -g -pthread demo.c target/debug/libldk.a -ldl -lm
 ./a.out
 
 # And run the C++ demo app
-g++ $LOCAL_CFLAGS -std=c++11 -Wall -g -pthread demo.cpp -Ltarget/debug/ -lldk -ldl
-LD_LIBRARY_PATH=target/debug/ ./a.out > /dev/null
+if [ "$2" = "true" ]; then
+       g++ $LOCAL_CFLAGS -std=c++11 -Wall -g -pthread demo.cpp -Ltarget/debug/ -lldk -ldl
+       LD_LIBRARY_PATH=target/debug/ ./a.out > /dev/null
+fi
 
 # Finally, run the C++ demo app with our native networking library
 # in valgrind to test memory model correctness and lack of leaks.
 gcc $LOCAL_CFLAGS -fPIC -std=c99 -Wall -g -pthread -I../ldk-net ../ldk-net/ldk_net.c -c -o ldk_net.o
-g++ $LOCAL_CFLAGS -std=c++11 -Wall -g -pthread -DREAL_NET -I../ldk-net ldk_net.o demo.cpp target/debug/libldk.a -ldl -lm
-if [ -x "`which valgrind`" ]; then
-       valgrind --error-exitcode=4 --memcheck:leak-check=full --show-leak-kinds=all ./a.out
-       echo
-else
-       echo "WARNING: Please install valgrind for more testing"
-       ./a.out
+if [ "$2" = "true" ]; then
+       g++ $LOCAL_CFLAGS -std=c++11 -Wall -g -pthread -DREAL_NET -I../ldk-net ldk_net.o demo.cpp target/debug/libldk.a -ldl -lm
+       if [ -x "`which valgrind`" ]; then
+               valgrind --error-exitcode=4 --memcheck:leak-check=full --show-leak-kinds=all ./a.out
+               echo
+       else
+               echo "WARNING: Please install valgrind for more testing"
+               ./a.out
+       fi
 fi
 
 
 # Test a statically-linked C++ version, tracking the resulting binary size and runtime
 # across debug, LTO, and cross-language LTO builds (using the same compiler each time).
-clang++ $LOCAL_CFLAGS -std=c++11 demo.cpp target/debug/libldk.a -ldl
-strip ./a.out
-echo " C++ Bin size and runtime w/o optimization:"
-ls -lha a.out
-time ./a.out > /dev/null
+if [ "$2" = "true" ]; then
+       clang++ $LOCAL_CFLAGS -std=c++11 demo.cpp target/debug/libldk.a -ldl
+       strip ./a.out
+       echo " C++ Bin size and runtime w/o optimization:"
+       ls -lha a.out
+       time ./a.out > /dev/null
+fi
 
 # Then, check with memory sanitizer, if we're on Linux and have rustc nightly
 if [ "$HOST_PLATFORM" = "host: x86_64-unknown-linux-gnu" ]; then
@@ -321,14 +327,16 @@ if [ "$HOST_PLATFORM" = "host: x86_64-unknown-linux-gnu" ]; then
                        clang-$LLVM_V $LOCAL_CFLAGS -fsanitize=memory -fsanitize-memory-track-origins -g demo.c target/debug/libldk.a -ldl
                        ./a.out
 
-                       # ...then the C++ demo app
-                       clang++-$LLVM_V $LOCAL_CFLAGS -std=c++11 -fsanitize=memory -fsanitize-memory-track-origins -g demo.cpp target/debug/libldk.a -ldl
-                       ./a.out >/dev/null
+                       if [ "$2" = "true" ]; then
+                               # ...then the C++ demo app
+                               clang++-$LLVM_V $LOCAL_CFLAGS -std=c++11 -fsanitize=memory -fsanitize-memory-track-origins -g demo.cpp target/debug/libldk.a -ldl
+                               ./a.out >/dev/null
 
-                       # ...then the C++ demo app with the ldk_net network implementation
-                       clang-$LLVM_V $LOCAL_CFLAGS -std=c99 -fsanitize=memory -fsanitize-memory-track-origins -g -I../ldk-net ../ldk-net/ldk_net.c -c -o ldk_net.o
-                       clang++-$LLVM_V $LOCAL_CFLAGS -std=c++11 -fsanitize=memory -fsanitize-memory-track-origins -g -DREAL_NET -I../ldk-net ldk_net.o demo.cpp target/debug/libldk.a -ldl
-                       ./a.out >/dev/null
+                               # ...then the C++ demo app with the ldk_net network implementation
+                               clang-$LLVM_V $LOCAL_CFLAGS -std=c99 -fsanitize=memory -fsanitize-memory-track-origins -g -I../ldk-net ../ldk-net/ldk_net.c -c -o ldk_net.o
+                               clang++-$LLVM_V $LOCAL_CFLAGS -std=c++11 -fsanitize=memory -fsanitize-memory-track-origins -g -DREAL_NET -I../ldk-net ldk_net.o demo.cpp target/debug/libldk.a -ldl
+                               ./a.out >/dev/null
+                       fi
 
                        # restore exit-on-failure
                        set -e
@@ -356,10 +364,20 @@ if [ "$HOST_PLATFORM" = "host: x86_64-apple-darwin" ]; then
                        LLD_LLVM_V="$(ld64.lld --version | awk '{ print substr($2, 0, 2); }')"
                fi
        fi
+       LLD_PFX=ld64.
 else
        CLANG_LLVM_V=$(clang --version | head -n1 | awk '{ print substr($4, 0, 2); }')
        if [ -x "$(which ld.lld)" ]; then
-               LLD_LLVM_V="$(ld.lld --version | awk '{ print substr($2, 0, 2); }')"
+               LLD_LLVM_V="$(ld.lld --version | awk '{ print $2; }')"
+               if [ "$LLD_LLVM_V" = "LLD" ]; then # eg if the output is "Debian LLD ..."
+                       LLD_LLVM_V="$(ld.lld --version | awk '{ print substr($3, 0, 2); }')"
+               else
+                       LLD_LLVM_V="$(ld.lld-$RUSTC_LLVM_V --version | awk '{ print substr($2, 0, 2); }')"
+               fi
+       fi
+       LLD_PFX=ld.
+       if [ $RUSTC_LLVM_V -lt "13" ]; then
+               LLD_PFX=
        fi
 fi
 
@@ -368,7 +386,7 @@ if [ "$CLANG_LLVM_V" = "$RUSTC_LLVM_V" ]; then
        CLANG=clang
        CLANGPP=clang++
        if [ "$LLD_LLVM_V" = "$CLANG_LLVM_V" ]; then
-               LLD=lld
+               LLD=${LLD_PFX}lld
        fi
 elif [ -x "$(which clang-$RUSTC_LLVM_V)" ]; then
        CLANG="$(which clang-$RUSTC_LLVM_V)"
@@ -379,8 +397,13 @@ elif [ -x "$(which clang-$RUSTC_LLVM_V)" ]; then
                unset CLANGPP
        fi
        if [ "$LLD_LLVM_V" != "$RUSTC_LLVM_V" ]; then
-               LLD="$(which lld-$RUSTC_LLVM_V || echo lld)"
-               LLD_LLVM_V="$(ld.$LLD --version | awk '{ print substr($2, 0, 2); }')"
+               LLD="$(which ${LLD_PFX}lld-$RUSTC_LLVM_V || echo ${LLD_PFX}lld)"
+               LLD_LLVM_V="$($LLD --version | awk '{ print $2; }')"
+               if [ "$LLD_LLVM_V" = "LLD" ]; then # eg if the output is "Debian LLD ..."
+                       LLD_LLVM_V="$(${LLD_PFX}lld-$RUSTC_LLVM_V --version | awk '{ print substr($3, 0, 2); }')"
+               else
+                       LLD_LLVM_V="$(${LLD_PFX}lld-$RUSTC_LLVM_V --version | awk '{ print substr($2, 0, 2); }')"
+               fi
                if [ "$LLD_LLVM_V" != "$RUSTC_LLVM_V" ]; then
                        echo "Could not find a workable version of lld, not using cross-language LTO"
                        unset LLD
@@ -412,14 +435,16 @@ if [ "$HOST_PLATFORM" = "host: x86_64-unknown-linux-gnu" -o "$HOST_PLATFORM" = "
                $CLANG $LOCAL_CFLAGS -fsanitize=address -g demo.c target/debug/libldk.a -ldl
                ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' ./a.out
 
-               # ...then the C++ demo app
-               $CLANGPP $LOCAL_CFLAGS -std=c++11 -fsanitize=address -g demo.cpp target/debug/libldk.a -ldl
-               ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' ./a.out >/dev/null
+               if [ "$2" = "true" ]; then
+                       # ...then the C++ demo app
+                       $CLANGPP $LOCAL_CFLAGS -std=c++11 -fsanitize=address -g demo.cpp target/debug/libldk.a -ldl
+                       ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' ./a.out >/dev/null
 
-               # ...then the C++ demo app with the ldk_net network implementation
-               $CLANG $LOCAL_CFLAGS -fPIC -fsanitize=address -g -I../ldk-net ../ldk-net/ldk_net.c -c -o ldk_net.o
-               $CLANGPP $LOCAL_CFLAGS -std=c++11 -fsanitize=address -g -DREAL_NET -I../ldk-net ldk_net.o demo.cpp target/debug/libldk.a -ldl
-               ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' ./a.out >/dev/null
+                       # ...then the C++ demo app with the ldk_net network implementation
+                       $CLANG $LOCAL_CFLAGS -fPIC -fsanitize=address -g -I../ldk-net ../ldk-net/ldk_net.c -c -o ldk_net.o
+                       $CLANGPP $LOCAL_CFLAGS -std=c++11 -fsanitize=address -g -DREAL_NET -I../ldk-net ldk_net.o demo.cpp target/debug/libldk.a -ldl
+                       ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' ./a.out >/dev/null
+               fi
        else
                echo "WARNING: Please install clang-$RUSTC_LLVM_V and clang++-$RUSTC_LLVM_V to build with address sanitizer"
        fi
@@ -431,7 +456,9 @@ fi
 # Clear stale release build artifacts from previous runs
 cargo clean --release
 CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release -- -C lto
-clang++ $LOCAL_CFLAGS -std=c++11 -O2 demo.cpp target/release/libldk.a -ldl
+if [ "$2" = "true" ]; then
+       clang++ $LOCAL_CFLAGS -std=c++11 -O2 demo.cpp target/release/libldk.a -ldl
+fi
 
 strip ./a.out
 echo "C++ Bin size and runtime with only RL (LTO) optimized:"
@@ -499,11 +526,14 @@ if [ "$CLANGPP" != "" -a "$LLD" != "" ]; then
        # Rust doesn't recognize CFLAGS changes, so we need to clean build artifacts
        cargo clean --release
        CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release -- -C linker-plugin-lto -C lto -C linker=$CLANG $LINK_ARG_FLAGS -C link-arg=-march=sandybridge -C link-arg=-mcpu=sandybridge -C link-arg=-mtune=sandybridge
-       $CLANGPP $LOCAL_CFLAGS -flto -fuse-ld=lld -O2 demo.cpp target/release/libldk.a -ldl
-       strip ./a.out
-       echo "C++ Bin size and runtime with cross-language LTO:"
-       ls -lha a.out
-       time ./a.out > /dev/null
+
+       if [ "$2" = "true" ]; then
+               $CLANGPP $LOCAL_CFLAGS -flto -fuse-ld=$LLD -O2 demo.cpp target/release/libldk.a -ldl
+               strip ./a.out
+               echo "C++ Bin size and runtime with cross-language LTO:"
+               ls -lha a.out
+               time ./a.out > /dev/null
+       fi
 else
        if [ "$CFLAGS_aarch64_apple_darwin" != "" ]; then
                RUSTFLAGS="$BASE_RUSTFLAGS -C target-cpu=apple-a14" CARGO_PROFILE_RELEASE_LTO=true cargo rustc -v --release --target aarch64-apple-darwin -- -C lto
index d783b08f9e264b3c99cec95c1fb3c39e7a73c06a..784422c36520d6d48e2e0005313eeba9eb716801 100644 (file)
@@ -18,10 +18,10 @@ crate-type = ["staticlib"
 bitcoin = "0.27"
 secp256k1 = { version = "0.20.3", 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 = "3c5d1bf5844477d7b77e4b5dbb5d65586ae3b192", features = ["allow_wallclock_use"] }
-lightning-persister = { git = "https://github.com/rust-bitcoin/rust-lightning", rev = "3c5d1bf5844477d7b77e4b5dbb5d65586ae3b192" }
-lightning-invoice = { git = "https://github.com/rust-bitcoin/rust-lightning", rev = "3c5d1bf5844477d7b77e4b5dbb5d65586ae3b192" }
-lightning-background-processor = { git = "https://github.com/rust-bitcoin/rust-lightning", rev = "3c5d1bf5844477d7b77e4b5dbb5d65586ae3b192" }
+lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "80ea2e51cdd3decf084574dee365065d782f7e8c", features = ["std"] }
+lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "80ea2e51cdd3decf084574dee365065d782f7e8c" }
+lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "80ea2e51cdd3decf084574dee365065d782f7e8c" }
+lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "80ea2e51cdd3decf084574dee365065d782f7e8c" }
 
 # Always force panic=abort, further options are set in the genbindings.sh build script
 [profile.dev]
index 62692495ae998adc2c89f7efc32863601d970c08..2ee7a2938f819d4a9c965815cbb4f6bbae6ed79b 100644 (file)
@@ -167,7 +167,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_monitor(const void *this_
                        LDKBroadcasterInterface broadcaster = {
                                .broadcast_transaction = broadcast_tx,
                        };
-                       LDK::CResult_NoneMonitorUpdateErrorZ res = ChannelMonitor_update_monitor(&mon.second, &update, &broadcaster, &fee_est, arg->logger);
+                       LDK::CResult_NoneNoneZ res = ChannelMonitor_update_monitor(&mon.second, &update, &broadcaster, &fee_est, arg->logger);
                        assert(res->result_ok);
                }
        }
@@ -421,13 +421,17 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ create_custom_msg(const void* this_arg) {
        return ret;
 }
 
-uint64_t get_chan_score(const void *this_arg, uint64_t scid, const LDKNodeId *src, const LDKNodeId *dst) { return 42; }
+uint64_t get_chan_score(const void *this_arg, uint64_t scid, uint64_t htlc_amt,
+LDKCOption_u64Z chan_capacity, const LDKNodeId *src, const LDKNodeId *dst) {
+       LDK::COption_u64Z _capacity(std::move(chan_capacity));
+       return 42;
+}
 
 struct CustomRouteFinderParams {
        LDKLogger *logger;
        LDKNetworkGraph *graph_ref;
 };
-struct LDKCResult_RouteLightningErrorZ custom_find_route(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer) {
+struct LDKCResult_RouteLightningErrorZ custom_find_route(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer) {
        const struct CustomRouteFinderParams *params = (struct CustomRouteFinderParams *)this_arg;
        assert(first_hops->datalen == 1);
        assert(ChannelDetails_get_is_usable(&first_hops->data[0]));
@@ -755,10 +759,13 @@ int main() {
                {
                        EventQueue queue;
                        LDKEventHandler handler = { .this_arg = &queue, .handle_event = handle_event, .free = NULL };
-                       ev1.process_pending_events(ev1.this_arg, handler);
-                       assert(queue.events.size() == 1);
+                       while (queue.events.size() < 2)
+                               ev1.process_pending_events(ev1.this_arg, handler);
+                       assert(queue.events.size() == 2);
                        assert(queue.events[0]->tag == LDKEvent_PaymentSent);
                        assert(!memcmp(queue.events[0]->payment_sent.payment_preimage.data, payment_preimage.data, 32));
+                       assert(queue.events[1]->tag == LDKEvent_PaymentPathSuccessful);
+                       assert(!memcmp(queue.events[1]->payment_path_successful.payment_hash.data, payment_hash.data, 32));
                }
 
                conn.stop();
@@ -856,7 +863,7 @@ int main() {
                .free = NULL,
        };
        LDK::Scorer scorer = Scorer_default();
-       LDK::LockableScore scorer_mtx = LockableScore_new(Scorer_as_Score(&scorer));
+       LDK::MultiThreadedLockableScore scorer_mtx = MultiThreadedLockableScore_new(Scorer_as_Score(&scorer));
        EventQueue queue1;
        LDKEventHandler handler1 = { .this_arg = &queue1, .handle_event = handle_event, .free = NULL };
        LDK::InvoicePayer payer = InvoicePayer_new(ChannelManager_as_Payer(&cm1), sending_router, &scorer_mtx, logger1, handler1, RetryAttempts_new(0));
@@ -909,7 +916,7 @@ int main() {
                std::this_thread::yield();
        }
 
-       while (queue1.events.size() == 0) {
+       while (queue1.events.size() < 2) {
                PeerManager_process_events(&net2);
                PeerManager_process_events(&net1);
 
@@ -917,8 +924,9 @@ int main() {
                LDK::EventHandler evh1 = InvoicePayer_as_EventHandler(&payer);
                ev1.process_pending_events(std::move(evh1));
        }
-       assert(queue1.events.size() == 1);
+       assert(queue1.events.size() == 2);
        assert(queue1.events[0]->tag == LDKEvent_PaymentSent);
+       assert(queue1.events[1]->tag == LDKEvent_PaymentPathSuccessful);
 
        // Actually close the channel
        num_txs_broadcasted = 0;
index bbd06e606bf5ca7e134ad20461823668f7b7df63..7ef9dd9d17a7402aa8ec25cf4d3c796fa86379c9 100644 (file)
@@ -56,8 +56,12 @@ struct nativeBestBlockOpaque;
 typedef struct nativeBestBlockOpaque LDKnativeBestBlock;
 struct nativeWatchedOutputOpaque;
 typedef struct nativeWatchedOutputOpaque LDKnativeWatchedOutput;
-struct nativeLockableScoreOpaque;
-typedef struct nativeLockableScoreOpaque LDKnativeLockableScore;
+struct nativeMultiThreadedLockableScoreOpaque;
+typedef struct nativeMultiThreadedLockableScoreOpaque LDKnativeMultiThreadedLockableScore;
+struct nativeScorerOpaque;
+typedef struct nativeScorerOpaque LDKnativeScorer;
+struct nativeScoringParametersOpaque;
+typedef struct nativeScoringParametersOpaque LDKnativeScoringParameters;
 struct nativeInitFeaturesOpaque;
 typedef struct nativeInitFeaturesOpaque LDKnativeInitFeatures;
 struct nativeNodeFeaturesOpaque;
@@ -66,10 +70,8 @@ struct nativeChannelFeaturesOpaque;
 typedef struct nativeChannelFeaturesOpaque LDKnativeChannelFeatures;
 struct nativeInvoiceFeaturesOpaque;
 typedef struct nativeInvoiceFeaturesOpaque LDKnativeInvoiceFeatures;
-struct nativeScorerOpaque;
-typedef struct nativeScorerOpaque LDKnativeScorer;
-struct nativeScoringParametersOpaque;
-typedef struct nativeScoringParametersOpaque LDKnativeScoringParameters;
+struct nativeChannelTypeFeaturesOpaque;
+typedef struct nativeChannelTypeFeaturesOpaque LDKnativeChannelTypeFeatures;
 struct nativeDelayedPaymentOutputDescriptorOpaque;
 typedef struct nativeDelayedPaymentOutputDescriptorOpaque LDKnativeDelayedPaymentOutputDescriptor;
 struct nativeStaticPaymentOutputDescriptorOpaque;
@@ -133,8 +135,6 @@ struct nativePrivateRouteOpaque;
 typedef struct nativePrivateRouteOpaque LDKnativePrivateRoute;
 struct nativeChannelMonitorUpdateOpaque;
 typedef struct nativeChannelMonitorUpdateOpaque LDKnativeChannelMonitorUpdate;
-struct nativeMonitorUpdateErrorOpaque;
-typedef struct nativeMonitorUpdateErrorOpaque LDKnativeMonitorUpdateError;
 struct nativeHTLCUpdateOpaque;
 typedef struct nativeHTLCUpdateOpaque LDKnativeHTLCUpdate;
 struct nativeChannelMonitorOpaque;
index 090c0ee8417baca1e20c69697d7f6f031525bdc5..7c5d88dda372d920c978b2ae6c5f1271db2f6d9c 100644 (file)
@@ -28,6 +28,24 @@ typedef enum LDKAccessError {
    LDKAccessError_Sentinel,
 } LDKAccessError;
 
+/**
+ * An enum which can either contain a  or not
+ */
+typedef enum LDKCOption_NoneZ {
+   /**
+    * When we're in this state, this COption_NoneZ contains a
+    */
+   LDKCOption_NoneZ_Some,
+   /**
+    * When we're in this state, this COption_NoneZ contains nothing
+    */
+   LDKCOption_NoneZ_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_NoneZ_Sentinel,
+} LDKCOption_NoneZ;
+
 /**
  * An error enum representing a failure to persist a channel monitor update.
  */
@@ -145,6 +163,10 @@ typedef enum LDKCreationError {
     * The supplied expiry time could cause an overflow if added to a `PositiveTimestamp`
     */
    LDKCreationError_ExpiryTimeOutOfBounds,
+   /**
+    * The supplied millisatoshi amount was greater than the total bitcoin supply.
+    */
+   LDKCreationError_InvalidAmount,
    /**
     * Must be last for serialization purposes
     */
@@ -213,6 +235,10 @@ typedef enum LDKIOError {
  * An enum representing the available verbosity levels of the logger.
  */
 typedef enum LDKLevel {
+   /**
+    * Designates extremely verbose information, including gossip-induced messages
+    */
+   LDKLevel_Gossip,
    /**
     * Designates very low priority, often extremely verbose, information
     */
@@ -2199,6 +2225,10 @@ typedef enum LDKClosureReason_Tag {
     * a copy of our own `ChannelMonitor`.
     */
    LDKClosureReason_CommitmentTxConfirmed,
+   /**
+    * The funding transaction failed to confirm in a timely manner on an inbound channel.
+    */
+   LDKClosureReason_FundingTimedOut,
    /**
     * Closure generated from processing an event, likely a HTLC forward/relay/reception.
     */
@@ -2613,17 +2643,6 @@ typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
     * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
     */
    struct LDKThirtyTwoBytes payment_secret;
-   /**
-    * This is the `user_payment_id` which was provided to
-    * [`ChannelManager::create_inbound_payment_for_hash`] or
-    * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
-    * simply copied here. It may be used to correlate PaymentReceived events with invoice
-    * metadata stored elsewhere.
-    *
-    * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
-    * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
-    */
-   uint64_t user_payment_id;
 } LDKPaymentPurpose_LDKInvoicePayment_Body;
 
 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
@@ -2646,10 +2665,13 @@ typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
 typedef enum LDKEvent_Tag {
    /**
     * 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.
+    * 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!
+    *
+    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+    * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
     */
    LDKEvent_FundingGenerationReady,
    /**
@@ -2662,6 +2684,10 @@ typedef enum LDKEvent_Tag {
     * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
     * automatically failed.
     *
+    * # Note
+    * LDK will not stop an inbound payment from being paid multiple times, so multiple
+    * `PaymentReceived` events may be generated for the same payment.
+    *
     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
     * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
     */
@@ -2675,13 +2701,31 @@ typedef enum LDKEvent_Tag {
     */
    LDKEvent_PaymentSent,
    /**
-    * Indicates an outbound payment we made failed. Probably some intermediary node dropped
+    * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
     * something. You may wish to retry with a different route.
+    *
+    * Note that this does *not* indicate that all paths for an MPP payment have failed, see
+    * [`Event::PaymentFailed`] and [`all_paths_failed`].
+    *
+    * [`all_paths_failed`]: Self::all_paths_failed
     */
    LDKEvent_PaymentPathFailed,
    /**
-    * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
-    * time in the future.
+    * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
+    * provide failure information for each MPP part in the payment.
+    *
+    * This event is provided once there are no further pending HTLCs for the payment and the
+    * payment is no longer retryable, either due to a several-block timeout or because
+    * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
+    *
+    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+    */
+   LDKEvent_PaymentFailed,
+   /**
+    * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
+    * a time in the future.
+    *
+    * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
     */
    LDKEvent_PendingHTLCsForwardable,
    /**
@@ -2706,6 +2750,13 @@ typedef enum LDKEvent_Tag {
     * inputs for another purpose.
     */
    LDKEvent_DiscardFunding,
+   /**
+    * Indicates that a path for an outbound payment was successful.
+    *
+    * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
+    * [`Event::PaymentSent`] for obtaining the payment preimage.
+    */
+   LDKEvent_PaymentPathSuccessful,
    /**
     * Must be last for serialization purposes
     */
@@ -2737,7 +2788,8 @@ typedef struct LDKEvent_LDKFundingGenerationReady_Body {
 
 typedef struct LDKEvent_LDKPaymentReceived_Body {
    /**
-    * The hash for which the preimage should be handed to the ChannelManager.
+    * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
+    * not stop you from registering duplicate payment hashes for inbound payments.
     */
    struct LDKThirtyTwoBytes payment_hash;
    /**
@@ -2769,7 +2821,7 @@ typedef struct LDKEvent_LDKPaymentSent_Body {
     */
    struct LDKThirtyTwoBytes payment_preimage;
    /**
-    * The hash which was given to [`ChannelManager::send_payment`].
+    * The hash that was given to [`ChannelManager::send_payment`].
     *
     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
     */
@@ -2791,16 +2843,19 @@ typedef struct LDKEvent_LDKPaymentSent_Body {
 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
    /**
     * The id returned by [`ChannelManager::send_payment`] and used with
-    * [`ChannelManager::retry_payment`].
+    * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
     *
     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
     * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
+    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
     *
     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
    struct LDKThirtyTwoBytes payment_id;
    /**
-    * The hash which was given to ChannelManager::send_payment.
+    * The hash that was given to [`ChannelManager::send_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
     */
    struct LDKThirtyTwoBytes payment_hash;
    /**
@@ -2824,6 +2879,20 @@ typedef struct LDKEvent_LDKPaymentPathFailed_Body {
     * For both single-path and multi-path payments, this is set if all paths of the payment have
     * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
     * larger MPP payment were still in flight when this event was generated.
+    *
+    * Note that if you are retrying individual MPP parts, using this value to determine if a
+    * payment has fully failed is race-y. Because multiple failures can happen prior to events
+    * being processed, you may retry in response to a first failure, with a second failure
+    * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
+    * you will see `all_paths_failed` set even though the retry of the first failure still
+    * has an associated in-flight HTLC. See (1) for an example of such a failure.
+    *
+    * If you wish to retry individual MPP parts and learn when a payment has failed, you must
+    * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
+    *
+    * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
+    *
+    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
     */
    bool all_paths_failed;
    /**
@@ -2850,6 +2919,24 @@ typedef struct LDKEvent_LDKPaymentPathFailed_Body {
    struct LDKRouteParameters retry;
 } LDKEvent_LDKPaymentPathFailed_Body;
 
+typedef struct LDKEvent_LDKPaymentFailed_Body {
+   /**
+    * The id returned by [`ChannelManager::send_payment`] and used with
+    * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
+    * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+    */
+   struct LDKThirtyTwoBytes payment_id;
+   /**
+    * The hash that was given to [`ChannelManager::send_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    */
+   struct LDKThirtyTwoBytes payment_hash;
+} LDKEvent_LDKPaymentFailed_Body;
+
 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
    /**
     * The minimum amount of time that should be waited prior to calling
@@ -2922,6 +3009,31 @@ typedef struct LDKEvent_LDKDiscardFunding_Body {
    struct LDKTransaction transaction;
 } LDKEvent_LDKDiscardFunding_Body;
 
+typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
+   /**
+    * The id returned by [`ChannelManager::send_payment`] and used with
+    * [`ChannelManager::retry_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
+    */
+   struct LDKThirtyTwoBytes payment_id;
+   /**
+    * The hash that was given to [`ChannelManager::send_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKThirtyTwoBytes payment_hash;
+   /**
+    * The payment path that was successful.
+    *
+    * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
+    */
+   struct LDKCVec_RouteHopZ path;
+} LDKEvent_LDKPaymentPathSuccessful_Body;
+
 typedef struct MUST_USE_STRUCT LDKEvent {
    LDKEvent_Tag tag;
    union {
@@ -2929,11 +3041,13 @@ typedef struct MUST_USE_STRUCT LDKEvent {
       LDKEvent_LDKPaymentReceived_Body payment_received;
       LDKEvent_LDKPaymentSent_Body payment_sent;
       LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
+      LDKEvent_LDKPaymentFailed_Body payment_failed;
       LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
       LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
       LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
       LDKEvent_LDKChannelClosed_Body channel_closed;
       LDKEvent_LDKDiscardFunding_Body discard_funding;
+      LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
    };
 } LDKEvent;
 
@@ -3295,6 +3409,12 @@ typedef enum LDKErrorAction_Tag {
     * If the error is logged, log it at the given level.
     */
    LDKErrorAction_IgnoreAndLog,
+   /**
+    * The peer provided us with a gossip message which we'd already seen. In most cases this
+    * should be ignored, but it may result in the message being forwarded if it is a duplicate of
+    * our own channel announcements.
+    */
+   LDKErrorAction_IgnoreDuplicateGossip,
    /**
     * The peer did something incorrect. Tell them.
     */
@@ -3755,327 +3875,389 @@ typedef struct LDKCVec_MessageSendEventZ {
 
 
 /**
- * Features used within an `init` message.
+ * Parameters for configuring [`Scorer`].
  */
-typedef struct MUST_USE_STRUCT LDKInitFeatures {
+typedef struct MUST_USE_STRUCT LDKScoringParameters {
    /**
     * 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.
     */
-   LDKnativeInitFeatures *inner;
+   LDKnativeScoringParameters *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;
-} LDKInitFeatures;
+} LDKScoringParameters;
 
 /**
- * The contents of CResult_InitFeaturesDecodeErrorZ
+ * The contents of CResult_ScoringParametersDecodeErrorZ
  */
-typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
+typedef union LDKCResult_ScoringParametersDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKInitFeatures *result;
+   struct LDKScoringParameters *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_InitFeaturesDecodeErrorZPtr;
+} LDKCResult_ScoringParametersDecodeErrorZPtr;
 
 /**
- * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_ScoringParametersDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::scoring::ScoringParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
+typedef struct LDKCResult_ScoringParametersDecodeErrorZ {
    /**
-    * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
+    * The contents of this CResult_ScoringParametersDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
+   union LDKCResult_ScoringParametersDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
+    * Whether this CResult_ScoringParametersDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_InitFeaturesDecodeErrorZ;
+} LDKCResult_ScoringParametersDecodeErrorZ;
 
 
 
 /**
- * Features used within a `node_announcement` message.
+ * [`Score`] implementation that provides reasonable default behavior.
+ *
+ * Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with
+ * slightly higher fees are available. Will further penalize channels that fail to relay payments.
+ *
+ * See [module-level documentation] for usage.
+ *
+ * [module-level documentation]: crate::routing::scoring
  */
-typedef struct MUST_USE_STRUCT LDKNodeFeatures {
+typedef struct MUST_USE_STRUCT LDKScorer {
    /**
     * 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.
     */
-   LDKnativeNodeFeatures *inner;
+   LDKnativeScorer *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;
-} LDKNodeFeatures;
+} LDKScorer;
 
 /**
- * The contents of CResult_NodeFeaturesDecodeErrorZ
+ * The contents of CResult_ScorerDecodeErrorZ
  */
-typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
+typedef union LDKCResult_ScorerDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKNodeFeatures *result;
+   struct LDKScorer *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_NodeFeaturesDecodeErrorZPtr;
+} LDKCResult_ScorerDecodeErrorZPtr;
 
 /**
- * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_ScorerDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::scoring::Scorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
+typedef struct LDKCResult_ScorerDecodeErrorZ {
    /**
-    * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
+    * The contents of this CResult_ScorerDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
+   union LDKCResult_ScorerDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
+    * Whether this CResult_ScorerDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_NodeFeaturesDecodeErrorZ;
+} LDKCResult_ScorerDecodeErrorZ;
 
 
 
 /**
- * Features used within a `channel_announcement` message.
+ * Features used within an `init` message.
  */
-typedef struct MUST_USE_STRUCT LDKChannelFeatures {
+typedef struct MUST_USE_STRUCT LDKInitFeatures {
    /**
     * 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.
     */
-   LDKnativeChannelFeatures *inner;
+   LDKnativeInitFeatures *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;
-} LDKChannelFeatures;
+} LDKInitFeatures;
 
 /**
- * The contents of CResult_ChannelFeaturesDecodeErrorZ
+ * The contents of CResult_InitFeaturesDecodeErrorZ
  */
-typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
+typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKChannelFeatures *result;
+   struct LDKInitFeatures *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_ChannelFeaturesDecodeErrorZPtr;
+} LDKCResult_InitFeaturesDecodeErrorZPtr;
 
 /**
- * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
+typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
    /**
-    * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
+    * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
+   union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
+    * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_ChannelFeaturesDecodeErrorZ;
+} LDKCResult_InitFeaturesDecodeErrorZ;
 
 
 
 /**
- * Features used within an invoice.
+ * Features used within a `channel_announcement` message.
  */
-typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
+typedef struct MUST_USE_STRUCT LDKChannelFeatures {
    /**
     * 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.
     */
-   LDKnativeInvoiceFeatures *inner;
+   LDKnativeChannelFeatures *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;
-} LDKInvoiceFeatures;
+} LDKChannelFeatures;
 
 /**
- * The contents of CResult_InvoiceFeaturesDecodeErrorZ
+ * The contents of CResult_ChannelFeaturesDecodeErrorZ
  */
-typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
+typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKInvoiceFeatures *result;
+   struct LDKChannelFeatures *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
+} LDKCResult_ChannelFeaturesDecodeErrorZPtr;
 
 /**
- * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
+typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
    /**
-    * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
+    * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
+   union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
+    * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_InvoiceFeaturesDecodeErrorZ;
+} LDKCResult_ChannelFeaturesDecodeErrorZ;
 
 
 
 /**
- * Parameters for configuring [`Scorer`].
+ * Features used within a `node_announcement` message.
  */
-typedef struct MUST_USE_STRUCT LDKScoringParameters {
+typedef struct MUST_USE_STRUCT LDKNodeFeatures {
    /**
     * 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.
     */
-   LDKnativeScoringParameters *inner;
+   LDKnativeNodeFeatures *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;
-} LDKScoringParameters;
+} LDKNodeFeatures;
 
 /**
- * The contents of CResult_ScoringParametersDecodeErrorZ
+ * The contents of CResult_NodeFeaturesDecodeErrorZ
  */
-typedef union LDKCResult_ScoringParametersDecodeErrorZPtr {
+typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKScoringParameters *result;
+   struct LDKNodeFeatures *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_ScoringParametersDecodeErrorZPtr;
+} LDKCResult_NodeFeaturesDecodeErrorZPtr;
 
 /**
- * A CResult_ScoringParametersDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::routing::scorer::ScoringParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_ScoringParametersDecodeErrorZ {
+typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
    /**
-    * The contents of this CResult_ScoringParametersDecodeErrorZ, accessible via either
+    * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_ScoringParametersDecodeErrorZPtr contents;
+   union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_ScoringParametersDecodeErrorZ represents a success state.
+    * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_ScoringParametersDecodeErrorZ;
+} LDKCResult_NodeFeaturesDecodeErrorZ;
 
 
 
 /**
- * [`routing::Score`] implementation that provides reasonable default behavior.
- *
- * Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with
- * slightly higher fees are available. Will further penalize channels that fail to relay payments.
- *
- * See [module-level documentation] for usage.
- *
- * [module-level documentation]: crate::routing::scorer
+ * Features used within an invoice.
  */
-typedef struct MUST_USE_STRUCT LDKScorer {
+typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
    /**
     * 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.
     */
-   LDKnativeScorer *inner;
+   LDKnativeInvoiceFeatures *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;
-} LDKScorer;
+} LDKInvoiceFeatures;
 
 /**
- * The contents of CResult_ScorerDecodeErrorZ
+ * The contents of CResult_InvoiceFeaturesDecodeErrorZ
  */
-typedef union LDKCResult_ScorerDecodeErrorZPtr {
+typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKScorer *result;
+   struct LDKInvoiceFeatures *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    struct LDKDecodeError *err;
-} LDKCResult_ScorerDecodeErrorZPtr;
+} LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
 
 /**
- * A CResult_ScorerDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::routing::scorer::Scorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_ScorerDecodeErrorZ {
+typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
    /**
-    * The contents of this CResult_ScorerDecodeErrorZ, accessible via either
+    * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_ScorerDecodeErrorZPtr contents;
+   union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_ScorerDecodeErrorZ represents a success state.
+    * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_ScorerDecodeErrorZ;
+} LDKCResult_InvoiceFeaturesDecodeErrorZ;
+
+
+
+/**
+ * Features used within the channel_type field in an OpenChannel message.
+ *
+ * A channel is always of some known \"type\", describing the transaction formats used and the exact
+ * semantics of our interaction with our peer.
+ *
+ * Note that because a channel is a specific type which is proposed by the opener and accepted by
+ * the counterparty, only required features are allowed here.
+ *
+ * This is serialized differently from other feature types - it is not prefixed by a length, and
+ * thus must only appear inside a TLV where its length is known in advance.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
+   /**
+    * 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.
+    */
+   LDKnativeChannelTypeFeatures *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;
+} LDKChannelTypeFeatures;
+
+/**
+ * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKChannelTypeFeatures *result;
+   /**
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKDecodeError *err;
+} LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
+   /**
+    * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
 
 /**
  * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
@@ -5320,14 +5502,14 @@ typedef struct LDKSixteenBytes {
 } LDKSixteenBytes;
 
 /**
- * A 10-byte byte array.
+ * A 12-byte byte array.
  */
-typedef struct LDKTenBytes {
+typedef struct LDKTwelveBytes {
    /**
-    * The ten bytes
+    * The twelve bytes
     */
-   uint8_t data[10];
-} LDKTenBytes;
+   uint8_t data[12];
+} LDKTwelveBytes;
 
 /**
  * An address which can be used to connect to a remote peer
@@ -5343,6 +5525,9 @@ typedef enum LDKNetAddress_Tag {
    LDKNetAddress_IPv6,
    /**
     * An old-style Tor onion address/port on which the peer is listening.
+    *
+    * This field is deprecated and the Tor network generally no longer supports V2 Onion
+    * addresses. Thus, the details are not parsed here.
     */
    LDKNetAddress_OnionV2,
    /**
@@ -5379,17 +5564,6 @@ typedef struct LDKNetAddress_LDKIPv6_Body {
    uint16_t port;
 } LDKNetAddress_LDKIPv6_Body;
 
-typedef struct LDKNetAddress_LDKOnionV2_Body {
-   /**
-    * The bytes (usually encoded in base32 with \".onion\" appended)
-    */
-   struct LDKTenBytes addr;
-   /**
-    * The port on which the node is listening
-    */
-   uint16_t port;
-} LDKNetAddress_LDKOnionV2_Body;
-
 typedef struct LDKNetAddress_LDKOnionV3_Body {
    /**
     * The ed25519 long-term public key of the peer
@@ -5414,7 +5588,9 @@ typedef struct MUST_USE_STRUCT LDKNetAddress {
    union {
       LDKNetAddress_LDKIPv4_Body i_pv4;
       LDKNetAddress_LDKIPv6_Body i_pv6;
-      LDKNetAddress_LDKOnionV2_Body onion_v2;
+      struct {
+         struct LDKTwelveBytes onion_v2;
+      };
       LDKNetAddress_LDKOnionV3_Body onion_v3;
    };
 } LDKNetAddress;
@@ -5449,6 +5625,103 @@ typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
    struct LDKThirtyTwoBytes b;
 } LDKC2Tuple_PaymentHashPaymentSecretZ;
 
+/**
+ * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
+ */
+typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
+   /**
+    * Note that this value is always NULL, as there are no contents in the Err variant
+    */
+   void *err;
+} LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
+
+/**
+ * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+   /**
+    * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
+   /**
+    * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
+
+/**
+ * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
+ */
+typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
+   /**
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKAPIError *err;
+} LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
+
+/**
+ * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+   /**
+    * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
+   /**
+    * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
+
+/**
+ * The contents of CResult_PaymentSecretNoneZ
+ */
+typedef union LDKCResult_PaymentSecretNoneZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKThirtyTwoBytes *result;
+   /**
+    * Note that this value is always NULL, as there are no contents in the Err variant
+    */
+   void *err;
+} LDKCResult_PaymentSecretNoneZPtr;
+
+/**
+ * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
+ * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentSecretNoneZ {
+   /**
+    * The contents of this CResult_PaymentSecretNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_PaymentSecretNoneZPtr contents;
+   /**
+    * Whether this CResult_PaymentSecretNoneZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_PaymentSecretNoneZ;
+
 /**
  * The contents of CResult_PaymentSecretAPIErrorZ
  */
@@ -5482,6 +5755,39 @@ typedef struct LDKCResult_PaymentSecretAPIErrorZ {
    bool result_ok;
 } LDKCResult_PaymentSecretAPIErrorZ;
 
+/**
+ * The contents of CResult_PaymentPreimageAPIErrorZ
+ */
+typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKThirtyTwoBytes *result;
+   /**
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKAPIError *err;
+} LDKCResult_PaymentPreimageAPIErrorZPtr;
+
+/**
+ * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
+   /**
+    * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
+   /**
+    * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_PaymentPreimageAPIErrorZ;
+
 /**
  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
  * This corresponds to std::vector in C++
@@ -5684,6 +5990,12 @@ typedef struct LDKKeysInterface {
     * blindly signing the hash.
     */
    struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKCVec_u8Z invoice_preimage);
+   /**
+    * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
+    *
+    * This method must return the same value each time it is called.
+    */
+   struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
@@ -5707,12 +6019,12 @@ typedef struct LDKFeeEstimator {
    /**
     * Gets estimated satoshis of fee required per 1000 Weight-Units.
     *
-    * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
-    * don't put us below 1 satoshi-per-byte).
+    * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
+    * round-downs don't put us below 1 satoshi-per-byte).
     *
-    * This translates to:
-    *  * satoshis-per-byte * 250
-    *  * ceil(satoshis-per-kbyte / 4)
+    * This method can be implemented with the following unit conversions:
+    *  * max(satoshis-per-byte * 250, 253)
+    *  * max(satoshis-per-kbyte / 4, 253)
     */
    uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
    /**
@@ -6842,62 +7154,6 @@ typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
    bool result_ok;
 } LDKCResult_HTLCUpdateDecodeErrorZ;
 
-
-
-/**
- * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
- * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
- * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
- * corrupted.
- * Contains a developer-readable error message.
- */
-typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
-   /**
-    * 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.
-    */
-   LDKnativeMonitorUpdateError *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;
-} LDKMonitorUpdateError;
-
-/**
- * The contents of CResult_NoneMonitorUpdateErrorZ
- */
-typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
-   /**
-    * Note that this value is always NULL, as there are no contents in the OK variant
-    */
-   void *result;
-   /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
-    */
-   struct LDKMonitorUpdateError *err;
-} LDKCResult_NoneMonitorUpdateErrorZPtr;
-
-/**
- * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
- * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
-   /**
-    * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
-    */
-   union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
-   /**
-    * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
-    */
-   bool result_ok;
-} LDKCResult_NoneMonitorUpdateErrorZ;
-
 /**
  * A tuple of 2 elements. See the individual fields for the types contained.
  */
@@ -10738,6 +10994,53 @@ typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
    bool is_owned;
 } LDKDirectedChannelTransactionParameters;
 
+
+
+/**
+ * A read-only view of [`NetworkGraph`].
+ */
+typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
+   /**
+    * 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.
+    */
+   LDKnativeReadOnlyNetworkGraph *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;
+} LDKReadOnlyNetworkGraph;
+
+
+
+/**
+ * Receives and validates network updates from peers,
+ * stores authentic and relevant data as a network graph.
+ * This network graph is then used for routing payments.
+ * Provides interface to help with initial routing sync by
+ * serving historical announcements.
+ *
+ * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
+ * [`NetworkGraph`].
+ */
+typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
+   /**
+    * 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.
+    */
+   LDKnativeNetGraphMsgHandler *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;
+} LDKNetGraphMsgHandler;
+
 /**
  * An interface used to score payment channels for path finding.
  *
@@ -10750,14 +11053,28 @@ typedef struct LDKScore {
     */
    void *this_arg;
    /**
-    * Returns the fee in msats willing to be paid to avoid routing through the given channel
-    * in the direction from `source` to `target`.
+    * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
+    * given channel in the direction from `source` to `target`.
+    *
+    * The channel's capacity (less any other MPP parts which are also being considered for use in
+    * the same payment) is given by `channel_capacity_msat`. It may be guessed from various
+    * sources or assumed from no data at all.
+    *
+    * For hints provided in the invoice, we assume the channel has sufficient capacity to accept
+    * the invoice's full amount, and provide a `channel_capacity_msat` of `None`. In all other
+    * cases it is set to `Some`, even if we're guessing at the channel value.
+    *
+    * Your code should be overflow-safe through a `channel_capacity_msat` of 21 million BTC.
     */
-   uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target);
+   uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, struct LDKCOption_u64Z channel_capacity_msat, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target);
    /**
     * Handles updating channel penalties after failing to route through a channel.
     */
    void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
+   /**
+    * Handles updating channel penalties after successfully routing along a path.
+    */
+   void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
    /**
     * Serialize the object into a byte array
     */
@@ -10769,8 +11086,6 @@ typedef struct LDKScore {
    void (*free)(void *this_arg);
 } LDKScore;
 
-
-
 /**
  * A scorer that is accessed under a lock.
  *
@@ -10781,67 +11096,42 @@ typedef struct LDKScore {
  *
  * [`find_route`]: crate::routing::router::find_route
  */
-typedef struct MUST_USE_STRUCT LDKLockableScore {
+typedef struct LDKLockableScore {
    /**
-    * 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.
-    */
-   LDKnativeLockableScore *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.
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
     */
-   bool is_owned;
-} LDKLockableScore;
-
-
-
-/**
- * A read-only view of [`NetworkGraph`].
- */
-typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
+   void *this_arg;
    /**
-    * 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.
+    * Returns the locked scorer.
     */
-   LDKnativeReadOnlyNetworkGraph *inner;
+   struct LDKScore (*lock)(const void *this_arg);
    /**
-    * 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.
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
     */
-   bool is_owned;
-} LDKReadOnlyNetworkGraph;
+   void (*free)(void *this_arg);
+} LDKLockableScore;
 
 
 
 /**
- * Receives and validates network updates from peers,
- * stores authentic and relevant data as a network graph.
- * This network graph is then used for routing payments.
- * Provides interface to help with initial routing sync by
- * serving historical announcements.
- *
- * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
- * [`NetworkGraph`].
+ * A concrete implementation of [`LockableScore`] which supports multi-threading.
  */
-typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
+typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
    /**
     * 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.
     */
-   LDKnativeNetGraphMsgHandler *inner;
+   LDKnativeMultiThreadedLockableScore *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;
-} LDKNetGraphMsgHandler;
+} LDKMultiThreadedLockableScore;
 
 
 
@@ -10886,6 +11176,8 @@ typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
  *   [`ChannelManager`] persistence should be done in the background.
  * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
  *   at the appropriate intervals.
+ * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`NetGraphMsgHandler`] is provided to
+ *   [`BackgroundProcessor::start`]).
  *
  * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
  * upon as doing so may result in high latency.
@@ -11072,10 +11364,18 @@ typedef struct LDKPayer {
     * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
    struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
+   /**
+    * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
+    */
+   struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
    /**
     * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
     */
    struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
+   /**
+    * Signals that no further retries for the given payment will occur.
+    */
+   void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
@@ -11097,7 +11397,7 @@ typedef struct LDKRouter {
     *
     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer);
+   struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer);
    /**
     * Frees any resources associated with this object given its this_arg pointer.
     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
@@ -11108,7 +11408,11 @@ typedef struct LDKRouter {
 
 
 /**
- * A utility for paying [`Invoice]`s.
+ * A utility for paying [`Invoice`]s and sending spontaneous payments.
+ *
+ * See [module-level documentation] for details.
+ *
+ * [module-level documentation]: crate::payment
  */
 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
    /**
@@ -11417,6 +11721,21 @@ void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutpu
  */
 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
 
+/**
+ * Constructs a new COption_NoneZ containing a
+ */
+enum LDKCOption_NoneZ COption_NoneZ_some(void);
+
+/**
+ * Constructs a new COption_NoneZ containing nothing
+ */
+enum LDKCOption_NoneZ COption_NoneZ_none(void);
+
+/**
+ * Frees any resources associated with the , if we are in the Some state
+ */
+void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
+
 /**
  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
  */
@@ -11664,6 +11983,12 @@ bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_
  */
 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
 
+/**
+ * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_NoneErrorZ in the success state.
  */
@@ -12148,44 +12473,64 @@ struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_
 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
 
 /**
- * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
+ * Creates a new CResult_ScoringParametersDecodeErrorZ in the success state.
  */
-struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
+struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o);
 
 /**
- * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
+ * Creates a new CResult_ScoringParametersDecodeErrorZ in the error state.
  */
-struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
+bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
+ * Frees any resources used by the CResult_ScoringParametersDecodeErrorZ.
  */
-void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
+void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
+ * Creates a new CResult_ScorerDecodeErrorZ in the success state.
  */
-struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
+struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o);
 
 /**
- * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
+ * Creates a new CResult_ScorerDecodeErrorZ in the error state.
  */
-struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
+bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
+ * Frees any resources used by the CResult_ScorerDecodeErrorZ.
  */
-void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
+void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
+
+/**
+ * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
+ */
+void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
 
 /**
  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
@@ -12208,64 +12553,64 @@ bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFe
 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
+ * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
  */
-struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
+struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
 
 /**
- * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
+ * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
  */
-struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
+bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
+ * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
  */
-void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
+void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_ScoringParametersDecodeErrorZ in the success state.
+ * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
  */
-struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o);
+struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
 
 /**
- * Creates a new CResult_ScoringParametersDecodeErrorZ in the error state.
+ * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
  */
-struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o);
+bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_ScoringParametersDecodeErrorZ.
+ * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
  */
-void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res);
+void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_ScorerDecodeErrorZ in the success state.
+ * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
  */
-struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o);
+struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
 
 /**
- * Creates a new CResult_ScorerDecodeErrorZ in the error state.
+ * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
  */
-struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
  * Checks if the given object is currently in the success state
  */
-bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o);
+bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the CResult_ScorerDecodeErrorZ.
+ * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
  */
-void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
+void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
 
 /**
  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
@@ -12817,6 +13162,84 @@ struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_ne
  */
 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
 
+/**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
+ */
+struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
+ */
+struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
+ */
+void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
+ */
+struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
+ */
+struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
+ */
+void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PaymentSecretNoneZ in the success state.
+ */
+struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult_PaymentSecretNoneZ in the error state.
+ */
+struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PaymentSecretNoneZ.
+ */
+void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
+
+/**
+ * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
  */
@@ -12843,6 +13266,32 @@ void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIError
  */
 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
 
+/**
+ * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
+ */
+struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
+ */
+struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
+ */
+void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
+
+/**
+ * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
+
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
@@ -13391,32 +13840,6 @@ void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeError
  */
 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
 
-/**
- * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
- */
-struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
-
-/**
- * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
- */
-struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
-
-/**
- * Checks if the given object is currently in the success state
- */
-bool CResult_NoneMonitorUpdateErrorZ_is_ok(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR o);
-
-/**
- * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
- */
-void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
-
-/**
- * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
-struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
-
 /**
  * Creates a new tuple which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
@@ -14934,7 +15357,7 @@ struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NO
 /**
  * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
  */
-struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t user_payment_id);
+struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
 
 /**
  * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
@@ -14971,6 +15394,11 @@ struct LDKClosureReason ClosureReason_cooperative_closure(void);
  */
 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
 
+/**
+ * Utility method to constructs a new FundingTimedOut-variant ClosureReason
+ */
+struct LDKClosureReason ClosureReason_funding_timed_out(void);
+
 /**
  * Utility method to constructs a new ProcessingError-variant ClosureReason
  */
@@ -15026,6 +15454,11 @@ struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct L
  */
 struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry);
 
+/**
+ * Utility method to constructs a new PaymentFailed-variant Event
+ */
+struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
+
 /**
  * Utility method to constructs a new PendingHTLCsForwardable-variant Event
  */
@@ -15051,6 +15484,11 @@ struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64
  */
 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
 
+/**
+ * Utility method to constructs a new PaymentPathSuccessful-variant Event
+ */
+struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
+
 /**
  * Serialize the Event object into a byte array which can be read by Event_read
  */
@@ -15244,6 +15682,11 @@ bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
  */
 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new Gossip-variant Level
+ */
+enum LDKLevel Level_gossip(void);
+
 /**
  * Utility method to constructs a new Trace-variant Level
  */
@@ -15969,10 +16412,22 @@ bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig
  */
 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
 
+/**
+ * If this is set to false, we do not accept inbound requests to open a new channel.
+ * Default value: true.
+ */
+bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If this is set to false, we do not accept inbound requests to open a new channel.
+ * Default value: true.
+ */
+void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+
 /**
  * Constructs a new UserConfig given each field
  */
-MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg);
+MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg);
 
 /**
  * Creates a copy of the UserConfig
@@ -16329,25 +16784,6 @@ struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpda
  */
 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
 
-/**
- * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
- */
-void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
-
-struct LDKStr MonitorUpdateError_get_a(const struct LDKMonitorUpdateError *NONNULL_PTR this_ptr);
-
-void MonitorUpdateError_set_a(struct LDKMonitorUpdateError *NONNULL_PTR this_ptr, struct LDKStr val);
-
-/**
- * Constructs a new MonitorUpdateError given each field
- */
-MUST_USE_RES struct LDKMonitorUpdateError MonitorUpdateError_new(struct LDKStr a_arg);
-
-/**
- * Creates a copy of the MonitorUpdateError
- */
-struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
-
 /**
  * Frees any resources used by the MonitorEvent
  */
@@ -16460,7 +16896,7 @@ struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_
  *
  * panics if the given update is not the next update by update_id.
  */
-MUST_USE_RES struct LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
 
 /**
  * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
@@ -16998,6 +17434,12 @@ MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDK
  */
 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
 
+/**
+ * Whether anchors should be used.
+ * Will panic if ready_channel wasn't called.
+ */
+MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+
 /**
  * Sign the single input of spend_tx at index `input_idx` which spends the output
  * described by descriptor, returning the witness stack for the input.
@@ -17378,12 +17820,42 @@ uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONN
  */
 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
 
+/**
+ * Our total balance.  This is the amount we would get if we close the channel.
+ * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+ * amount is not likely to be recoverable on close.
+ *
+ * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+ * balance is not available for inclusion in new outbound HTLCs). This further does not include
+ * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+ * This does not consider any on-chain fees.
+ *
+ * See also [`ChannelDetails::outbound_capacity_msat`]
+ */
+uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Our total balance.  This is the amount we would get if we close the channel.
+ * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+ * amount is not likely to be recoverable on close.
+ *
+ * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+ * balance is not available for inclusion in new outbound HTLCs). This further does not include
+ * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+ * This does not consider any on-chain fees.
+ *
+ * See also [`ChannelDetails::outbound_capacity_msat`]
+ */
+void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
 /**
  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
- * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+ * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
  * available for inclusion in new outbound HTLCs). This further does not include any pending
  * outgoing HTLCs which are awaiting some other resolution to be sent.
  *
+ * See also [`ChannelDetails::balance_msat`]
+ *
  * This value is not exact. Due to various in-flight changes, feerate changes, and our
  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
  * should be able to spend nearly this amount.
@@ -17392,10 +17864,12 @@ uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetail
 
 /**
  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
- * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+ * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
  * available for inclusion in new outbound HTLCs). This further does not include any pending
  * outgoing HTLCs which are awaiting some other resolution to be sent.
  *
+ * See also [`ChannelDetails::balance_msat`]
+ *
  * This value is not exact. Due to various in-flight changes, feerate changes, and our
  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
  * should be able to spend nearly this amount.
@@ -17404,7 +17878,7 @@ void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL
 
 /**
  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
- * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+ * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
  * available for inclusion in new inbound HTLCs).
  * Note that there are some corner cases not fully handled here, so the actual available
  * inbound capacity may be slightly higher than this.
@@ -17417,7 +17891,7 @@ uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails
 
 /**
  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
- * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+ * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
  * available for inclusion in new inbound HTLCs).
  * Note that there are some corner cases not fully handled here, so the actual available
  * inbound capacity may be slightly higher than this.
@@ -17541,7 +18015,7 @@ void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr
 /**
  * Constructs a new ChannelDetails given each field
  */
-MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
+MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
 
 /**
  * Creates a copy of the ChannelDetails
@@ -17753,13 +18227,33 @@ MUST_USE_RES struct LDKCResult_PaymentIdPaymentSendFailureZ ChannelManager_send_
  *
  * Errors returned are a superset of those returned from [`send_payment`], so see
  * [`send_payment`] documentation for more details on errors. This method will also error if the
- * retry amount puts the payment more than 10% over the payment's total amount, or if the payment
- * for the given `payment_id` cannot be found (likely due to timeout or success).
+ * retry amount puts the payment more than 10% over the payment's total amount, if the payment
+ * for the given `payment_id` cannot be found (likely due to timeout or success), or if
+ * further retries have been disabled with [`abandon_payment`].
  *
  * [`send_payment`]: [`ChannelManager::send_payment`]
+ * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
  */
 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
 
+/**
+ * Signals that no further retries for the given payment will occur.
+ *
+ * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
+ * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
+ * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
+ * pending HTLCs for this payment.
+ *
+ * Note that calling this method does *not* prevent a payment from succeeding. You must still
+ * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
+ * determine the ultimate status of a payment.
+ *
+ * [`retry_payment`]: Self::retry_payment
+ * [`Event::PaymentFailed`]: events::Event::PaymentFailed
+ * [`Event::PaymentSent`]: events::Event::PaymentSent
+ */
+void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
+
 /**
  * Send a spontaneous payment, which is a payment that does not require the recipient to have
  * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
@@ -17786,7 +18280,8 @@ MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
  * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
  * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
  *
- * Panics if a funding transaction has already been provided for this channel.
+ * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
+ * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
  *
  * May panic if the output found in the funding transaction is duplicative with some other
  * channel (note that this should be trivially prevented by using unique funding transaction
@@ -17801,6 +18296,7 @@ MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
  * create a new channel with a conflicting funding transaction.
  *
  * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
+ * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
  */
 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKTransaction funding_transaction);
 
@@ -17858,19 +18354,21 @@ void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_
 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
 
 /**
- * Provides a payment preimage in response to a PaymentReceived event, returning true and
- * generating message events for the net layer to claim the payment, if possible. Thus, you
- * should probably kick the net layer to go send messages if this returns true!
+ * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
+ * [`MessageSendEvent`]s needed to claim the payment.
  *
  * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
  * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
  * event matches your expectation. If you fail to do so and call this method, you may provide
  * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
  *
- * May panic if called except in response to a PaymentReceived event.
+ * Returns whether any HTLCs were claimed, and thus if any new [`MessageSendEvent`]s are now
+ * pending for processing via [`get_and_clear_pending_msg_events`].
  *
+ * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
  * [`create_inbound_payment`]: Self::create_inbound_payment
  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+ * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
  */
 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
 
@@ -17884,7 +18382,7 @@ MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDK
  * to pay us.
  *
  * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
- * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
+ * [`PaymentHash`] and [`PaymentPreimage`] for you.
  *
  * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
  * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
@@ -17892,12 +18390,33 @@ MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDK
  *
  * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
  *
+ * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+ * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ *
+ * # Note
+ *
+ * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+ * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ *
+ * Errors if `min_value_msat` is greater than total bitcoin supply.
+ *
  * [`claim_funds`]: Self::claim_funds
  * [`PaymentReceived`]: events::Event::PaymentReceived
  * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
  */
-MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id);
+MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+
+/**
+ * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
+ * serialized state with LDK node(s) running 0.0.103 and earlier.
+ *
+ * # Note
+ * This method is deprecated and will be removed soon.
+ *
+ * [`create_inbound_payment`]: Self::create_inbound_payment
+ */
+MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ChannelManager_create_inbound_payment_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
 
 /**
  * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
@@ -17907,14 +18426,9 @@ MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_i
  * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
  * the `min_value_msat` provided here, if one is provided.
  *
- * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
- * method may return an Err if another payment with the same payment_hash is still pending.
- *
- * `user_payment_id` will be provided back in [`PaymentPurpose::InvoicePayment::user_payment_id`] events to
- * allow tracking of which events correspond with which calls to this and
- * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
- * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
- * with invoice metadata stored elsewhere.
+ * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
+ * note that LDK will not stop you from registering duplicate payment hashes for inbound
+ * payments.
  *
  * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
  * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
@@ -17933,20 +18447,44 @@ MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_i
  * If you need exact expiry semantics, you should enforce them upon receipt of
  * [`PaymentReceived`].
  *
- * Pending inbound payments are stored in memory and in serialized versions of this
- * [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
- * space is limited, you may wish to rate-limit inbound payment creation.
- *
  * May panic if `invoice_expiry_delta_secs` is greater than one year.
  *
  * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
  * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
  *
+ * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+ * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ *
+ * # Note
+ *
+ * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+ * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ *
+ * Errors if `min_value_msat` is greater than total bitcoin supply.
+ *
  * [`create_inbound_payment`]: Self::create_inbound_payment
  * [`PaymentReceived`]: events::Event::PaymentReceived
- * [`PaymentPurpose::InvoicePayment::user_payment_id`]: events::PaymentPurpose::InvoicePayment::user_payment_id
  */
-MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id);
+MUST_USE_RES struct LDKCResult_PaymentSecretNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+
+/**
+ * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
+ * serialized state with LDK node(s) running 0.0.103 and earlier.
+ *
+ * # Note
+ * This method is deprecated and will be removed soon.
+ *
+ * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+ */
+MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+
+/**
+ * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
+ * previously returned from [`create_inbound_payment`].
+ *
+ * [`create_inbound_payment`]: Self::create_inbound_payment
+ */
+MUST_USE_RES struct LDKCResult_PaymentPreimageAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
 
 /**
  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
@@ -17977,7 +18515,8 @@ struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONN
  * indicating whether persistence is necessary. Only one listener on
  * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
  * up.
- * Note that the feature `allow_wallclock_use` must be enabled to use this function.
+ *
+ * Note that this method is not available with the `no-std` feature.
  */
 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
 
@@ -18431,6 +18970,24 @@ uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR t
  */
 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
 
+/**
+ * The channel type that this channel will represent. If none is set, we derive the channel
+ * type from the intersection of our feature bits with our counterparty's feature bits from
+ * the Init message.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+
+/**
+ * The channel type that this channel will represent. If none is set, we derive the channel
+ * type from the intersection of our feature bits with our counterparty's feature bits from
+ * the Init message.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+
 /**
  * Creates a copy of the OpenChannel
  */
@@ -19298,7 +19855,7 @@ struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port)
 /**
  * Utility method to constructs a new OnionV2-variant NetAddress
  */
-struct LDKNetAddress NetAddress_onion_v2(struct LDKTenBytes addr, uint16_t port);
+struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
 
 /**
  * Utility method to constructs a new OnionV3-variant NetAddress
@@ -19945,6 +20502,11 @@ struct LDKErrorAction ErrorAction_ignore_error(void);
  */
 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
 
+/**
+ * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
+ */
+struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
+
 /**
  * Utility method to constructs a new SendErrorMessage-variant ErrorAction
  */
@@ -20682,6 +21244,16 @@ void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR t
  */
 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
 
+/**
+ * Gets the weight for an HTLC-Success transaction.
+ */
+uint64_t htlc_success_tx_weight(bool opt_anchors);
+
+/**
+ * Gets the weight for an HTLC-Timeout transaction.
+ */
+uint64_t htlc_timeout_tx_weight(bool opt_anchors);
+
 /**
  * Build the commitment secret from the seed and the commitment number
  */
@@ -21021,7 +21593,7 @@ struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read
  * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
  * does not need to have its previous_output_index filled.
  */
-struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
+struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
 
 /**
  * Gets the redeemscript for a funding output from the two funding public keys.
@@ -21038,7 +21610,17 @@ struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, st
  * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
  * commitment transaction).
  */
-struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
+struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
+
+/**
+ * Gets the witnessScript for an anchor output from the funding public key.
+ * The witness in the spending input must be:
+ * <BIP 143 funding_signature>
+ * After 16 blocks of confirmation, an alternative satisfying witness could be:
+ * <>
+ * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
+ */
+struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
 
 /**
  * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
@@ -21107,10 +21689,20 @@ struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struc
  */
 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
 
+/**
+ * Are anchors used for this channel.  Boolean is serialization backwards-compatible
+ */
+enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
+
+/**
+ * Are anchors used for this channel.  Boolean is serialization backwards-compatible
+ */
+void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+
 /**
  * Constructs a new ChannelTransactionParameters given each field
  */
-MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg);
+MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, enum LDKCOption_NoneZ opt_anchors_arg);
 
 /**
  * Creates a copy of the ChannelTransactionParameters
@@ -21227,6 +21819,11 @@ MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct
  */
 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
 
+/**
+ * Whether to use anchors for this channel
+ */
+MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
+
 /**
  * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
  */
@@ -21337,6 +21934,16 @@ MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LD
  */
 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
 
+/**
+ * Creates a copy of the ClosingTransaction
+ */
+struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
+
+/**
+ * Checks if two ClosingTransactions contain equal inner contents.
+ */
+uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
+
 /**
  * Construct an object of the class
  */
@@ -21485,6 +22092,11 @@ MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_b
  */
 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
 
+/**
+ * Should anchors be used.
+ */
+MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
+
 /**
  * Get a signature for each HTLC which was included in the commitment transaction (ie for
  * which HTLCOutputInCommitment::transaction_output_index.is_some()).
@@ -21531,6 +22143,13 @@ bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const st
  */
 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
 
+/**
+ * Checks if two ChannelTypeFeaturess contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
+
 /**
  * Creates a copy of the InitFeatures
  */
@@ -21551,6 +22170,11 @@ struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures
  */
 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
 
+/**
+ * Creates a copy of the ChannelTypeFeatures
+ */
+struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
+
 /**
  * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
  */
@@ -21571,6 +22195,11 @@ void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
  */
 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
 
+/**
+ * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
+ */
+void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
+
 /**
  * Create a blank Features with no features set
  */
@@ -21636,19 +22265,20 @@ MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
 
 /**
- * Returns whether the `payment_secret` feature is supported.
+ * Create a blank Features with no features set
  */
-MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
 
 /**
- * Returns whether the `payment_secret` feature is supported.
+ * Creates a Features with the bits set which are known by the implementation
  */
-MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
 
 /**
- * Returns whether the `payment_secret` feature is supported.
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
  */
-MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
+MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
 
 /**
  * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
@@ -21656,9 +22286,9 @@ MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoic
 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
 
 /**
- * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
+ * Read a InitFeatures from a byte array, created by InitFeatures_write
  */
-struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
+struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
 
 /**
  * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
@@ -21666,14 +22296,14 @@ struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR
 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
 
 /**
- * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
+ * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
  */
-struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
+struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
 
 /**
- * Read a InitFeatures from a byte array, created by InitFeatures_write
+ * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
  */
-struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
 
 /**
  * Read a NodeFeatures from a byte array, created by NodeFeatures_write
@@ -21681,15 +22311,25 @@ struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice s
 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
 
 /**
- * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
+ * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
  */
-struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
 
 /**
  * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
  */
 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
 
+/**
+ * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
+ */
+struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
+
+/**
+ * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
+ */
+struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
+
 /**
  * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
  */
@@ -21724,6 +22364,11 @@ void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_P
  */
 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
 
+/**
+ * Creates a copy of the InvalidShutdownScript
+ */
+struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
+
 /**
  * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
  */
@@ -21785,26 +22430,6 @@ void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
  */
 void Type_free(struct LDKType this_ptr);
 
-/**
- * Calls the free function if one is set
- */
-void Score_free(struct LDKScore this_ptr);
-
-/**
- * Frees any resources used by the LockableScore, if is_owned is set and inner is non-NULL.
- */
-void LockableScore_free(struct LDKLockableScore this_obj);
-
-/**
- * Constructs a new LockableScore from a Score
- */
-MUST_USE_RES struct LDKLockableScore LockableScore_new(struct LDKScore score);
-
-/**
- * Serialize the LockableScore object into a byte array which can be read by LockableScore_read
- */
-struct LDKCVec_u8Z LockableScore_write(const struct LDKLockableScore *NONNULL_PTR obj);
-
 /**
  * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
  */
@@ -22129,11 +22754,6 @@ struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct
  */
 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
 
-/**
- * Constructs a new ChannelInfo given each field
- */
-MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKNodeId node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKNodeId node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg);
-
 /**
  * Creates a copy of the ChannelInfo
  */
@@ -22443,6 +23063,20 @@ void NetworkGraph_close_channel_from_update(const struct LDKNetworkGraph *NONNUL
  */
 void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
 
+/**
+ * Removes information about channels that we haven't heard any updates about in some time.
+ * This can be used regularly to prune the network graph of channels that likely no longer
+ * exist.
+ *
+ * While there is no formal requirement that nodes regularly re-broadcast their channel
+ * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
+ * pruning occur for updates which are at least two weeks old, which we implement here.
+ *
+ * This function takes the current unix time as an argument. For users with the `std` feature
+ * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
+ */
+void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
+
 /**
  * For an already known (from announcement) channel, update info about one of the directions
  * of the channel.
@@ -22450,6 +23084,9 @@ void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg,
  * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
  * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
  * routing messages from a source using a protocol other than the lightning P2P protocol.
+ *
+ * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
+ * materially in the future will be rejected.
  */
 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
 
@@ -22457,6 +23094,9 @@ MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(c
  * For an already known (from announcement) channel, update info about one of the directions
  * of the channel without verifying the associated signatures. Because we aren't given the
  * associated signatures here we cannot relay the channel update to any of our peers.
+ *
+ * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
+ * materially in the future will be rejected.
  */
 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
 
@@ -22994,6 +23634,26 @@ struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice s
  */
 struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR params, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer);
 
+/**
+ * Calls the free function if one is set
+ */
+void Score_free(struct LDKScore this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void LockableScore_free(struct LDKLockableScore this_ptr);
+
+/**
+ * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
+ */
+void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
+
+/**
+ * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
+ */
+MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
+
 /**
  * Frees any resources used by the Scorer, if is_owned is set and inner is non-NULL.
  */
@@ -23006,11 +23666,15 @@ void ScoringParameters_free(struct LDKScoringParameters this_obj);
 
 /**
  * A fixed penalty in msats to apply to each channel.
+ *
+ * Default value: 500 msat
  */
 uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
 
 /**
  * A fixed penalty in msats to apply to each channel.
+ *
+ * Default value: 500 msat
  */
 void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
 
@@ -23018,7 +23682,9 @@ void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNUL
  * A penalty in msats to apply to a channel upon failing to relay a payment.
  *
  * This accumulates for each failure but may be reduced over time based on
- * [`failure_penalty_half_life`].
+ * [`failure_penalty_half_life`] or when successfully routing through a channel.
+ *
+ * Default value: 1,024,000 msat
  *
  * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
  */
@@ -23028,20 +23694,66 @@ uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParam
  * A penalty in msats to apply to a channel upon failing to relay a payment.
  *
  * This accumulates for each failure but may be reduced over time based on
- * [`failure_penalty_half_life`].
+ * [`failure_penalty_half_life`] or when successfully routing through a channel.
+ *
+ * Default value: 1,024,000 msat
  *
  * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
  */
 void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
 
+/**
+ * When the amount being sent over a channel is this many 1024ths of the total channel
+ * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
+ *
+ * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
+ *
+ * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
+ */
+uint16_t ScoringParameters_get_overuse_penalty_start_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+
+/**
+ * When the amount being sent over a channel is this many 1024ths of the total channel
+ * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
+ *
+ * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
+ *
+ * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
+ */
+void ScoringParameters_set_overuse_penalty_start_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
+ * over the channel exceeds [`overuse_penalty_start_1024th`] by.
+ *
+ * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
+ *                to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
+ *
+ * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
+ */
+uint64_t ScoringParameters_get_overuse_penalty_msat_per_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+
+/**
+ * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
+ * over the channel exceeds [`overuse_penalty_start_1024th`] by.
+ *
+ * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
+ *                to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
+ *
+ * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
+ */
+void ScoringParameters_set_overuse_penalty_msat_per_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+
 /**
  * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
  * cut in half.
  *
+ * Successfully routing through a channel will immediately cut the penalty in half as well.
+ *
  * # Note
  *
- * When time is an [`Eternity`], as is default when enabling feature `no-std`, it will never
- * elapse. Therefore, this penalty will never decay.
+ * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
+ * never decay.
  *
  * [`failure_penalty_msat`]: Self::failure_penalty_msat
  */
@@ -23051,10 +23763,12 @@ uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoring
  * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
  * cut in half.
  *
+ * Successfully routing through a channel will immediately cut the penalty in half as well.
+ *
  * # Note
  *
- * When time is an [`Eternity`], as is default when enabling feature `no-std`, it will never
- * elapse. Therefore, this penalty will never decay.
+ * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
+ * never decay.
  *
  * [`failure_penalty_msat`]: Self::failure_penalty_msat
  */
@@ -23063,7 +23777,7 @@ void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters
 /**
  * Constructs a new ScoringParameters given each field
  */
-MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint64_t failure_penalty_half_life_arg);
+MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint16_t overuse_penalty_start_1024th_arg, uint64_t overuse_penalty_msat_per_1024th_arg, uint64_t failure_penalty_half_life_arg);
 
 /**
  * Serialize the ScoringParameters object into a byte array which can be read by ScoringParameters_read
@@ -23175,7 +23889,7 @@ void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
  * functionality implemented by other handlers.
  * * [`NetGraphMsgHandler`] if given will update the [`NetworkGraph`] based on payment failures.
  *
- * [top-level documentation]: Self
+ * [top-level documentation]: BackgroundProcessor
  * [`join`]: Self::join
  * [`stop`]: Self::stop
  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
@@ -23909,6 +24623,11 @@ enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
  */
 enum LDKCreationError CreationError_expiry_time_out_of_bounds(void);
 
+/**
+ * Utility method to constructs a new InvalidAmount-variant CreationError
+ */
+enum LDKCreationError CreationError_invalid_amount(void);
+
 /**
  * Checks if two CreationErrors contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -24094,7 +24813,7 @@ struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
  * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
  * `retry_attempts` has been exceeded for a given [`Invoice`].
  */
-MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts);
+MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts);
 
 /**
  * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
@@ -24115,6 +24834,15 @@ MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(c
  */
 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_zero_value_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats);
 
+/**
+ * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
+ * case a retry is needed.
+ *
+ * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
+ * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
+ */
+MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_pubkey(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, uint64_t amount_msats, uint32_t final_cltv_expiry_delta);
+
 /**
  * Removes the payment cached by the given payment hash.
  *
index d4c68a5831b431ad85ee5c9584a1f78228c9e5e2..0b964d71f06e5a07559fe549e437019b888a36a5 100644 (file)
@@ -45,12 +45,14 @@ class EventsProvider;
 class EventHandler;
 class Score;
 class LockableScore;
+class MultiThreadedLockableScore;
+class Scorer;
+class ScoringParameters;
 class InitFeatures;
 class NodeFeatures;
 class ChannelFeatures;
 class InvoiceFeatures;
-class Scorer;
-class ScoringParameters;
+class ChannelTypeFeatures;
 class DelayedPaymentOutputDescriptor;
 class StaticPaymentOutputDescriptor;
 class SpendableOutputDescriptor;
@@ -99,7 +101,6 @@ class CreationError;
 class SemanticError;
 class SignOrCreationError;
 class ChannelMonitorUpdate;
-class MonitorUpdateError;
 class MonitorEvent;
 class HTLCUpdate;
 class Balance;
@@ -188,20 +189,20 @@ class COption_NetworkUpdateZ;
 class COption_u64Z;
 class CResult_TxOutAccessErrorZ;
 class CResult_TrustedClosingTransactionNoneZ;
+class CResult_PaymentPreimageAPIErrorZ;
 class CResult_ChannelMonitorUpdateDecodeErrorZ;
-class C2Tuple_PublicKeyTypeZ;
 class CResult_RouteHintDecodeErrorZ;
+class C2Tuple_PublicKeyTypeZ;
 class CResult_NetAddressDecodeErrorZ;
 class CResult_ChannelReestablishDecodeErrorZ;
-class CResult_UnsignedNodeAnnouncementDecodeErrorZ;
 class CResult_CommitmentSignedDecodeErrorZ;
 class CVec_UpdateAddHTLCZ;
-class CResult_ReplyChannelRangeDecodeErrorZ;
+class CResult_UnsignedNodeAnnouncementDecodeErrorZ;
+class CResult_StaticPaymentOutputDescriptorDecodeErrorZ;
 class COption_u32Z;
 class CResult_InitFeaturesDecodeErrorZ;
-class CResult_StaticPaymentOutputDescriptorDecodeErrorZ;
 class CResult_PaymentIdPaymentSendFailureZ;
-class CResult_GossipTimestampFilterDecodeErrorZ;
+class CResult_ReplyChannelRangeDecodeErrorZ;
 class CResult_CommitmentTransactionDecodeErrorZ;
 class COption_C2Tuple_usizeTransactionZZ;
 class CResult_TransactionNoneZ;
@@ -209,12 +210,12 @@ class CResult_SignedRawInvoiceNoneZ;
 class CResult_ExpiryTimeCreationErrorZ;
 class CResult_ClosingSignedFeeRangeDecodeErrorZ;
 class CResult_PingDecodeErrorZ;
-class CResult_InvoiceSignOrCreationErrorZ;
+class CResult_GossipTimestampFilterDecodeErrorZ;
 class CVec_TransactionOutputsZ;
 class CResult_ErrorMessageDecodeErrorZ;
 class CResult_OpenChannelDecodeErrorZ;
 class CVec_CVec_u8ZZ;
-class COption_FilterZ;
+class CResult_InvoiceSignOrCreationErrorZ;
 class CResult_SecretKeyErrorZ;
 class CResult_ShutdownScriptDecodeErrorZ;
 class CResult_InvoiceNoneZ;
@@ -240,6 +241,7 @@ class CResult_NodeAnnouncementInfoDecodeErrorZ;
 class C3Tuple_RawInvoice_u832InvoiceSignatureZ;
 class CVec_UpdateFailMalformedHTLCZ;
 class CResult_FundingSignedDecodeErrorZ;
+class COption_FilterZ;
 class CResult_NetworkGraphDecodeErrorZ;
 class CVec_RouteHopZ;
 class CVec_C2Tuple_BlockHashChannelMonitorZZ;
@@ -253,6 +255,7 @@ class CResult_HolderCommitmentTransactionDecodeErrorZ;
 class CVec_CResult_NoneAPIErrorZZ;
 class CResult_SignatureNoneZ;
 class CVec_RouteHintHopZ;
+class CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
 class C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
 class CResult_InitDecodeErrorZ;
 class CResult_OutPointDecodeErrorZ;
@@ -265,27 +268,28 @@ class CResult_UpdateFailMalformedHTLCDecodeErrorZ;
 class CVec_NodeAnnouncementZ;
 class CResult_UnsignedChannelAnnouncementDecodeErrorZ;
 class CVec_TxidZ;
-class CResult_NoneMonitorUpdateErrorZ;
+class COption_AccessZ;
 class CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
 class CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
 class CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
 class CResult_CVec_CVec_u8ZZNoneZ;
 class C2Tuple_PaymentHashPaymentSecretZ;
-class COption_AccessZ;
+class CResult_AcceptChannelDecodeErrorZ;
 class C2Tuple_BlockHashChannelManagerZ;
 class CResult_ChannelTransactionParametersDecodeErrorZ;
-class CResult_AcceptChannelDecodeErrorZ;
+class CResult_PongDecodeErrorZ;
 class CVec_SignatureZ;
 class CVec_u64Z;
 class CResult_ScorerDecodeErrorZ;
 class CResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
 class C2Tuple_PaymentHashPaymentIdZ;
-class CResult_StringErrorZ;
+class CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
 class CResult_NoneErrorZ;
+class CResult_StringErrorZ;
 class C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
-class CResult_PongDecodeErrorZ;
 class CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
 class COption_EventZ;
+class CResult_ChannelTypeFeaturesDecodeErrorZ;
 class CVec_RouteHintZ;
 class COption_u16Z;
 class CVec_CVec_RouteHopZZ;
@@ -317,6 +321,7 @@ class CResult_COption_TypeZDecodeErrorZ;
 class CResult_DirectionalChannelInfoDecodeErrorZ;
 class C2Tuple_u32TxOutZ;
 class CResult_UpdateFailHTLCDecodeErrorZ;
+class CResult_PaymentSecretNoneZ;
 class CResult_ChannelConfigDecodeErrorZ;
 class CVec_PrivateRouteZ;
 class CResult_SpendableOutputDescriptorDecodeErrorZ;
@@ -332,9 +337,9 @@ class CResult_COption_ClosureReasonZDecodeErrorZ;
 class CResult_SiPrefixNoneZ;
 class CResult_PublicKeyErrorZ;
 class C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
-class CResult_NoneNoneZ;
 class CResult_RouteParametersDecodeErrorZ;
 class COption_ClosureReasonZ;
+class CResult_NoneNoneZ;
 class CVec_APIErrorZ;
 class CResult_PrivateRouteCreationErrorZ;
 class CResult_boolPeerHandleErrorZ;
@@ -349,8 +354,9 @@ class C2Tuple_u32ScriptZ;
 class CResult_ReplyShortChannelIdsEndDecodeErrorZ;
 class CResult_RouteDecodeErrorZ;
 class CResult_BuiltCommitmentTransactionDecodeErrorZ;
-class CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
+class COption_NoneZ;
 class CVec_TxOutZ;
+class CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
 class CVec_UpdateFailHTLCZ;
 class CResult_FundingLockedDecodeErrorZ;
 
@@ -756,12 +762,12 @@ public:
        /**
         *  Gets estimated satoshis of fee required per 1000 Weight-Units.
         * 
-        *  Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
-        *  don't put us below 1 satoshi-per-byte).
+        *  Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
+        *  round-downs don't put us below 1 satoshi-per-byte).
         * 
-        *  This translates to:
-        *   * satoshis-per-byte * 250
-        *   * ceil(satoshis-per-kbyte / 4)
+        *  This method can be implemented with the following unit conversions:
+        *   * max(satoshis-per-byte * 250, 253)
+        *   * max(satoshis-per-kbyte / 4, 253)
         */
        inline uint32_t get_est_sat_per_1000_weight(enum LDKConfirmationTarget confirmation_target);
 };
@@ -1156,14 +1162,28 @@ public:
        const LDKScore* operator &() const { return &self; }
        const LDKScore* operator ->() const { return &self; }
        /**
-        *  Returns the fee in msats willing to be paid to avoid routing through the given channel
-        *  in the direction from `source` to `target`.
+        *  Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
+        *  given channel in the direction from `source` to `target`.
+        * 
+        *  The channel's capacity (less any other MPP parts which are also being considered for use in
+        *  the same payment) is given by `channel_capacity_msat`. It may be guessed from various
+        *  sources or assumed from no data at all.
+        * 
+        *  For hints provided in the invoice, we assume the channel has sufficient capacity to accept
+        *  the invoice's full amount, and provide a `channel_capacity_msat` of `None`. In all other
+        *  cases it is set to `Some`, even if we're guessing at the channel value.
+        * 
+        *  Your code should be overflow-safe through a `channel_capacity_msat` of 21 million BTC.
         */
-       inline uint64_t channel_penalty_msat(uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target);
+       inline uint64_t channel_penalty_msat(uint64_t short_channel_id, uint64_t send_amt_msat, struct LDKCOption_u64Z channel_capacity_msat, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target);
        /**
         *  Handles updating channel penalties after failing to route through a channel.
         */
        inline void payment_path_failed(struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
+       /**
+        *  Handles updating channel penalties after successfully routing along a path.
+        */
+       inline void payment_path_successful(struct LDKCVec_RouteHopZ path);
 };
 class LockableScore {
 private:
@@ -1179,6 +1199,55 @@ public:
        LDKLockableScore* operator ->() { return &self; }
        const LDKLockableScore* operator &() const { return &self; }
        const LDKLockableScore* operator ->() const { return &self; }
+       /**
+        *  Returns the locked scorer.
+        */
+       inline LDK::Score lock();
+};
+class MultiThreadedLockableScore {
+private:
+       LDKMultiThreadedLockableScore self;
+public:
+       MultiThreadedLockableScore(const MultiThreadedLockableScore&) = delete;
+       MultiThreadedLockableScore(MultiThreadedLockableScore&& o) : self(o.self) { memset(&o, 0, sizeof(MultiThreadedLockableScore)); }
+       MultiThreadedLockableScore(LDKMultiThreadedLockableScore&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMultiThreadedLockableScore)); }
+       operator LDKMultiThreadedLockableScore() && { LDKMultiThreadedLockableScore res = self; memset(&self, 0, sizeof(LDKMultiThreadedLockableScore)); return res; }
+       ~MultiThreadedLockableScore() { MultiThreadedLockableScore_free(self); }
+       MultiThreadedLockableScore& operator=(MultiThreadedLockableScore&& o) { MultiThreadedLockableScore_free(self); self = o.self; memset(&o, 0, sizeof(MultiThreadedLockableScore)); return *this; }
+       LDKMultiThreadedLockableScore* operator &() { return &self; }
+       LDKMultiThreadedLockableScore* operator ->() { return &self; }
+       const LDKMultiThreadedLockableScore* operator &() const { return &self; }
+       const LDKMultiThreadedLockableScore* operator ->() const { return &self; }
+};
+class Scorer {
+private:
+       LDKScorer self;
+public:
+       Scorer(const Scorer&) = delete;
+       Scorer(Scorer&& o) : self(o.self) { memset(&o, 0, sizeof(Scorer)); }
+       Scorer(LDKScorer&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKScorer)); }
+       operator LDKScorer() && { LDKScorer res = self; memset(&self, 0, sizeof(LDKScorer)); return res; }
+       ~Scorer() { Scorer_free(self); }
+       Scorer& operator=(Scorer&& o) { Scorer_free(self); self = o.self; memset(&o, 0, sizeof(Scorer)); return *this; }
+       LDKScorer* operator &() { return &self; }
+       LDKScorer* operator ->() { return &self; }
+       const LDKScorer* operator &() const { return &self; }
+       const LDKScorer* operator ->() const { return &self; }
+};
+class ScoringParameters {
+private:
+       LDKScoringParameters self;
+public:
+       ScoringParameters(const ScoringParameters&) = delete;
+       ScoringParameters(ScoringParameters&& o) : self(o.self) { memset(&o, 0, sizeof(ScoringParameters)); }
+       ScoringParameters(LDKScoringParameters&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKScoringParameters)); }
+       operator LDKScoringParameters() && { LDKScoringParameters res = self; memset(&self, 0, sizeof(LDKScoringParameters)); return res; }
+       ~ScoringParameters() { ScoringParameters_free(self); }
+       ScoringParameters& operator=(ScoringParameters&& o) { ScoringParameters_free(self); self = o.self; memset(&o, 0, sizeof(ScoringParameters)); return *this; }
+       LDKScoringParameters* operator &() { return &self; }
+       LDKScoringParameters* operator ->() { return &self; }
+       const LDKScoringParameters* operator &() const { return &self; }
+       const LDKScoringParameters* operator ->() const { return &self; }
 };
 class InitFeatures {
 private:
@@ -1240,35 +1309,20 @@ public:
        const LDKInvoiceFeatures* operator &() const { return &self; }
        const LDKInvoiceFeatures* operator ->() const { return &self; }
 };
-class Scorer {
+class ChannelTypeFeatures {
 private:
-       LDKScorer self;
+       LDKChannelTypeFeatures self;
 public:
-       Scorer(const Scorer&) = delete;
-       Scorer(Scorer&& o) : self(o.self) { memset(&o, 0, sizeof(Scorer)); }
-       Scorer(LDKScorer&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKScorer)); }
-       operator LDKScorer() && { LDKScorer res = self; memset(&self, 0, sizeof(LDKScorer)); return res; }
-       ~Scorer() { Scorer_free(self); }
-       Scorer& operator=(Scorer&& o) { Scorer_free(self); self = o.self; memset(&o, 0, sizeof(Scorer)); return *this; }
-       LDKScorer* operator &() { return &self; }
-       LDKScorer* operator ->() { return &self; }
-       const LDKScorer* operator &() const { return &self; }
-       const LDKScorer* operator ->() const { return &self; }
-};
-class ScoringParameters {
-private:
-       LDKScoringParameters self;
-public:
-       ScoringParameters(const ScoringParameters&) = delete;
-       ScoringParameters(ScoringParameters&& o) : self(o.self) { memset(&o, 0, sizeof(ScoringParameters)); }
-       ScoringParameters(LDKScoringParameters&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKScoringParameters)); }
-       operator LDKScoringParameters() && { LDKScoringParameters res = self; memset(&self, 0, sizeof(LDKScoringParameters)); return res; }
-       ~ScoringParameters() { ScoringParameters_free(self); }
-       ScoringParameters& operator=(ScoringParameters&& o) { ScoringParameters_free(self); self = o.self; memset(&o, 0, sizeof(ScoringParameters)); return *this; }
-       LDKScoringParameters* operator &() { return &self; }
-       LDKScoringParameters* operator ->() { return &self; }
-       const LDKScoringParameters* operator &() const { return &self; }
-       const LDKScoringParameters* operator ->() const { return &self; }
+       ChannelTypeFeatures(const ChannelTypeFeatures&) = delete;
+       ChannelTypeFeatures(ChannelTypeFeatures&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelTypeFeatures)); }
+       ChannelTypeFeatures(LDKChannelTypeFeatures&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelTypeFeatures)); }
+       operator LDKChannelTypeFeatures() && { LDKChannelTypeFeatures res = self; memset(&self, 0, sizeof(LDKChannelTypeFeatures)); return res; }
+       ~ChannelTypeFeatures() { ChannelTypeFeatures_free(self); }
+       ChannelTypeFeatures& operator=(ChannelTypeFeatures&& o) { ChannelTypeFeatures_free(self); self = o.self; memset(&o, 0, sizeof(ChannelTypeFeatures)); return *this; }
+       LDKChannelTypeFeatures* operator &() { return &self; }
+       LDKChannelTypeFeatures* operator ->() { return &self; }
+       const LDKChannelTypeFeatures* operator &() const { return &self; }
+       const LDKChannelTypeFeatures* operator ->() const { return &self; }
 };
 class DelayedPaymentOutputDescriptor {
 private:
@@ -1558,6 +1612,12 @@ public:
         *  blindly signing the hash.
         */
        inline LDK::CResult_RecoverableSignatureNoneZ sign_invoice(struct LDKCVec_u8Z invoice_preimage);
+       /**
+        *  Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
+        * 
+        *  This method must return the same value each time it is called.
+        */
+       inline LDKThirtyTwoBytes get_inbound_payment_key_material();
 };
 class InMemorySigner {
 private:
@@ -1887,10 +1947,18 @@ public:
         *  Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        inline LDK::CResult_PaymentIdPaymentSendFailureZ send_payment(const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
+       /**
+        *  Sends a spontaneous payment over the Lightning Network using the given [`Route`].
+        */
+       inline LDK::CResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment(const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
        /**
         *  Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
         */
        inline LDK::CResult_NonePaymentSendFailureZ retry_payment(const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
+       /**
+        *  Signals that no further retries for the given payment will occur.
+        */
+       inline void abandon_payment(struct LDKThirtyTwoBytes payment_id);
 };
 class Router {
 private:
@@ -1911,7 +1979,7 @@ public:
         * 
         *  Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       inline LDK::CResult_RouteLightningErrorZ find_route(struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer);
+       inline LDK::CResult_RouteLightningErrorZ find_route(struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer);
 };
 class RetryAttempts {
 private:
@@ -2224,21 +2292,6 @@ public:
        const LDKChannelMonitorUpdate* operator &() const { return &self; }
        const LDKChannelMonitorUpdate* operator ->() const { return &self; }
 };
-class MonitorUpdateError {
-private:
-       LDKMonitorUpdateError self;
-public:
-       MonitorUpdateError(const MonitorUpdateError&) = delete;
-       MonitorUpdateError(MonitorUpdateError&& o) : self(o.self) { memset(&o, 0, sizeof(MonitorUpdateError)); }
-       MonitorUpdateError(LDKMonitorUpdateError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMonitorUpdateError)); }
-       operator LDKMonitorUpdateError() && { LDKMonitorUpdateError res = self; memset(&self, 0, sizeof(LDKMonitorUpdateError)); return res; }
-       ~MonitorUpdateError() { MonitorUpdateError_free(self); }
-       MonitorUpdateError& operator=(MonitorUpdateError&& o) { MonitorUpdateError_free(self); self = o.self; memset(&o, 0, sizeof(MonitorUpdateError)); return *this; }
-       LDKMonitorUpdateError* operator &() { return &self; }
-       LDKMonitorUpdateError* operator ->() { return &self; }
-       const LDKMonitorUpdateError* operator &() const { return &self; }
-       const LDKMonitorUpdateError* operator ->() const { return &self; }
-};
 class MonitorEvent {
 private:
        LDKMonitorEvent self;
@@ -3806,6 +3859,21 @@ public:
        const LDKCResult_TrustedClosingTransactionNoneZ* operator &() const { return &self; }
        const LDKCResult_TrustedClosingTransactionNoneZ* operator ->() const { return &self; }
 };
+class CResult_PaymentPreimageAPIErrorZ {
+private:
+       LDKCResult_PaymentPreimageAPIErrorZ self;
+public:
+       CResult_PaymentPreimageAPIErrorZ(const CResult_PaymentPreimageAPIErrorZ&) = delete;
+       CResult_PaymentPreimageAPIErrorZ(CResult_PaymentPreimageAPIErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PaymentPreimageAPIErrorZ)); }
+       CResult_PaymentPreimageAPIErrorZ(LDKCResult_PaymentPreimageAPIErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PaymentPreimageAPIErrorZ)); }
+       operator LDKCResult_PaymentPreimageAPIErrorZ() && { LDKCResult_PaymentPreimageAPIErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PaymentPreimageAPIErrorZ)); return res; }
+       ~CResult_PaymentPreimageAPIErrorZ() { CResult_PaymentPreimageAPIErrorZ_free(self); }
+       CResult_PaymentPreimageAPIErrorZ& operator=(CResult_PaymentPreimageAPIErrorZ&& o) { CResult_PaymentPreimageAPIErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PaymentPreimageAPIErrorZ)); return *this; }
+       LDKCResult_PaymentPreimageAPIErrorZ* operator &() { return &self; }
+       LDKCResult_PaymentPreimageAPIErrorZ* operator ->() { return &self; }
+       const LDKCResult_PaymentPreimageAPIErrorZ* operator &() const { return &self; }
+       const LDKCResult_PaymentPreimageAPIErrorZ* operator ->() const { return &self; }
+};
 class CResult_ChannelMonitorUpdateDecodeErrorZ {
 private:
        LDKCResult_ChannelMonitorUpdateDecodeErrorZ self;
@@ -3821,21 +3889,6 @@ public:
        const LDKCResult_ChannelMonitorUpdateDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_ChannelMonitorUpdateDecodeErrorZ* operator ->() const { return &self; }
 };
-class C2Tuple_PublicKeyTypeZ {
-private:
-       LDKC2Tuple_PublicKeyTypeZ self;
-public:
-       C2Tuple_PublicKeyTypeZ(const C2Tuple_PublicKeyTypeZ&) = delete;
-       C2Tuple_PublicKeyTypeZ(C2Tuple_PublicKeyTypeZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_PublicKeyTypeZ)); }
-       C2Tuple_PublicKeyTypeZ(LDKC2Tuple_PublicKeyTypeZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_PublicKeyTypeZ)); }
-       operator LDKC2Tuple_PublicKeyTypeZ() && { LDKC2Tuple_PublicKeyTypeZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_PublicKeyTypeZ)); return res; }
-       ~C2Tuple_PublicKeyTypeZ() { C2Tuple_PublicKeyTypeZ_free(self); }
-       C2Tuple_PublicKeyTypeZ& operator=(C2Tuple_PublicKeyTypeZ&& o) { C2Tuple_PublicKeyTypeZ_free(self); self = o.self; memset(&o, 0, sizeof(C2Tuple_PublicKeyTypeZ)); return *this; }
-       LDKC2Tuple_PublicKeyTypeZ* operator &() { return &self; }
-       LDKC2Tuple_PublicKeyTypeZ* operator ->() { return &self; }
-       const LDKC2Tuple_PublicKeyTypeZ* operator &() const { return &self; }
-       const LDKC2Tuple_PublicKeyTypeZ* operator ->() const { return &self; }
-};
 class CResult_RouteHintDecodeErrorZ {
 private:
        LDKCResult_RouteHintDecodeErrorZ self;
@@ -3851,6 +3904,21 @@ public:
        const LDKCResult_RouteHintDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_RouteHintDecodeErrorZ* operator ->() const { return &self; }
 };
+class C2Tuple_PublicKeyTypeZ {
+private:
+       LDKC2Tuple_PublicKeyTypeZ self;
+public:
+       C2Tuple_PublicKeyTypeZ(const C2Tuple_PublicKeyTypeZ&) = delete;
+       C2Tuple_PublicKeyTypeZ(C2Tuple_PublicKeyTypeZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_PublicKeyTypeZ)); }
+       C2Tuple_PublicKeyTypeZ(LDKC2Tuple_PublicKeyTypeZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_PublicKeyTypeZ)); }
+       operator LDKC2Tuple_PublicKeyTypeZ() && { LDKC2Tuple_PublicKeyTypeZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_PublicKeyTypeZ)); return res; }
+       ~C2Tuple_PublicKeyTypeZ() { C2Tuple_PublicKeyTypeZ_free(self); }
+       C2Tuple_PublicKeyTypeZ& operator=(C2Tuple_PublicKeyTypeZ&& o) { C2Tuple_PublicKeyTypeZ_free(self); self = o.self; memset(&o, 0, sizeof(C2Tuple_PublicKeyTypeZ)); return *this; }
+       LDKC2Tuple_PublicKeyTypeZ* operator &() { return &self; }
+       LDKC2Tuple_PublicKeyTypeZ* operator ->() { return &self; }
+       const LDKC2Tuple_PublicKeyTypeZ* operator &() const { return &self; }
+       const LDKC2Tuple_PublicKeyTypeZ* operator ->() const { return &self; }
+};
 class CResult_NetAddressDecodeErrorZ {
 private:
        LDKCResult_NetAddressDecodeErrorZ self;
@@ -3881,21 +3949,6 @@ public:
        const LDKCResult_ChannelReestablishDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_ChannelReestablishDecodeErrorZ* operator ->() const { return &self; }
 };
-class CResult_UnsignedNodeAnnouncementDecodeErrorZ {
-private:
-       LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ self;
-public:
-       CResult_UnsignedNodeAnnouncementDecodeErrorZ(const CResult_UnsignedNodeAnnouncementDecodeErrorZ&) = delete;
-       CResult_UnsignedNodeAnnouncementDecodeErrorZ(CResult_UnsignedNodeAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UnsignedNodeAnnouncementDecodeErrorZ)); }
-       CResult_UnsignedNodeAnnouncementDecodeErrorZ(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ)); }
-       operator LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ() && { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ)); return res; }
-       ~CResult_UnsignedNodeAnnouncementDecodeErrorZ() { CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(self); }
-       CResult_UnsignedNodeAnnouncementDecodeErrorZ& operator=(CResult_UnsignedNodeAnnouncementDecodeErrorZ&& o) { CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UnsignedNodeAnnouncementDecodeErrorZ)); return *this; }
-       LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() { return &self; }
-       LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() { return &self; }
-       const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() const { return &self; }
-       const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() const { return &self; }
-};
 class CResult_CommitmentSignedDecodeErrorZ {
 private:
        LDKCResult_CommitmentSignedDecodeErrorZ self;
@@ -3926,20 +3979,35 @@ public:
        const LDKCVec_UpdateAddHTLCZ* operator &() const { return &self; }
        const LDKCVec_UpdateAddHTLCZ* operator ->() const { return &self; }
 };
-class CResult_ReplyChannelRangeDecodeErrorZ {
+class CResult_UnsignedNodeAnnouncementDecodeErrorZ {
 private:
-       LDKCResult_ReplyChannelRangeDecodeErrorZ self;
+       LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ self;
 public:
-       CResult_ReplyChannelRangeDecodeErrorZ(const CResult_ReplyChannelRangeDecodeErrorZ&) = delete;
-       CResult_ReplyChannelRangeDecodeErrorZ(CResult_ReplyChannelRangeDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ReplyChannelRangeDecodeErrorZ)); }
-       CResult_ReplyChannelRangeDecodeErrorZ(LDKCResult_ReplyChannelRangeDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ)); }
-       operator LDKCResult_ReplyChannelRangeDecodeErrorZ() && { LDKCResult_ReplyChannelRangeDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ)); return res; }
-       ~CResult_ReplyChannelRangeDecodeErrorZ() { CResult_ReplyChannelRangeDecodeErrorZ_free(self); }
-       CResult_ReplyChannelRangeDecodeErrorZ& operator=(CResult_ReplyChannelRangeDecodeErrorZ&& o) { CResult_ReplyChannelRangeDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ReplyChannelRangeDecodeErrorZ)); return *this; }
-       LDKCResult_ReplyChannelRangeDecodeErrorZ* operator &() { return &self; }
-       LDKCResult_ReplyChannelRangeDecodeErrorZ* operator ->() { return &self; }
-       const LDKCResult_ReplyChannelRangeDecodeErrorZ* operator &() const { return &self; }
-       const LDKCResult_ReplyChannelRangeDecodeErrorZ* operator ->() const { return &self; }
+       CResult_UnsignedNodeAnnouncementDecodeErrorZ(const CResult_UnsignedNodeAnnouncementDecodeErrorZ&) = delete;
+       CResult_UnsignedNodeAnnouncementDecodeErrorZ(CResult_UnsignedNodeAnnouncementDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_UnsignedNodeAnnouncementDecodeErrorZ)); }
+       CResult_UnsignedNodeAnnouncementDecodeErrorZ(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ)); }
+       operator LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ() && { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ)); return res; }
+       ~CResult_UnsignedNodeAnnouncementDecodeErrorZ() { CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(self); }
+       CResult_UnsignedNodeAnnouncementDecodeErrorZ& operator=(CResult_UnsignedNodeAnnouncementDecodeErrorZ&& o) { CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_UnsignedNodeAnnouncementDecodeErrorZ)); return *this; }
+       LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() { return &self; }
+       LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() { return &self; }
+       const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() const { return &self; }
+       const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() const { return &self; }
+};
+class CResult_StaticPaymentOutputDescriptorDecodeErrorZ {
+private:
+       LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ self;
+public:
+       CResult_StaticPaymentOutputDescriptorDecodeErrorZ(const CResult_StaticPaymentOutputDescriptorDecodeErrorZ&) = delete;
+       CResult_StaticPaymentOutputDescriptorDecodeErrorZ(CResult_StaticPaymentOutputDescriptorDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_StaticPaymentOutputDescriptorDecodeErrorZ)); }
+       CResult_StaticPaymentOutputDescriptorDecodeErrorZ(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ)); }
+       operator LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ() && { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ)); return res; }
+       ~CResult_StaticPaymentOutputDescriptorDecodeErrorZ() { CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(self); }
+       CResult_StaticPaymentOutputDescriptorDecodeErrorZ& operator=(CResult_StaticPaymentOutputDescriptorDecodeErrorZ&& o) { CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_StaticPaymentOutputDescriptorDecodeErrorZ)); return *this; }
+       LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* operator &() { return &self; }
+       LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* operator ->() { return &self; }
+       const LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* operator &() const { return &self; }
+       const LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* operator ->() const { return &self; }
 };
 class COption_u32Z {
 private:
@@ -3971,21 +4039,6 @@ public:
        const LDKCResult_InitFeaturesDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_InitFeaturesDecodeErrorZ* operator ->() const { return &self; }
 };
-class CResult_StaticPaymentOutputDescriptorDecodeErrorZ {
-private:
-       LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ self;
-public:
-       CResult_StaticPaymentOutputDescriptorDecodeErrorZ(const CResult_StaticPaymentOutputDescriptorDecodeErrorZ&) = delete;
-       CResult_StaticPaymentOutputDescriptorDecodeErrorZ(CResult_StaticPaymentOutputDescriptorDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_StaticPaymentOutputDescriptorDecodeErrorZ)); }
-       CResult_StaticPaymentOutputDescriptorDecodeErrorZ(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ)); }
-       operator LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ() && { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ)); return res; }
-       ~CResult_StaticPaymentOutputDescriptorDecodeErrorZ() { CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(self); }
-       CResult_StaticPaymentOutputDescriptorDecodeErrorZ& operator=(CResult_StaticPaymentOutputDescriptorDecodeErrorZ&& o) { CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_StaticPaymentOutputDescriptorDecodeErrorZ)); return *this; }
-       LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* operator &() { return &self; }
-       LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* operator ->() { return &self; }
-       const LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* operator &() const { return &self; }
-       const LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* operator ->() const { return &self; }
-};
 class CResult_PaymentIdPaymentSendFailureZ {
 private:
        LDKCResult_PaymentIdPaymentSendFailureZ self;
@@ -4001,20 +4054,20 @@ public:
        const LDKCResult_PaymentIdPaymentSendFailureZ* operator &() const { return &self; }
        const LDKCResult_PaymentIdPaymentSendFailureZ* operator ->() const { return &self; }
 };
-class CResult_GossipTimestampFilterDecodeErrorZ {
+class CResult_ReplyChannelRangeDecodeErrorZ {
 private:
-       LDKCResult_GossipTimestampFilterDecodeErrorZ self;
+       LDKCResult_ReplyChannelRangeDecodeErrorZ self;
 public:
-       CResult_GossipTimestampFilterDecodeErrorZ(const CResult_GossipTimestampFilterDecodeErrorZ&) = delete;
-       CResult_GossipTimestampFilterDecodeErrorZ(CResult_GossipTimestampFilterDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); }
-       CResult_GossipTimestampFilterDecodeErrorZ(LDKCResult_GossipTimestampFilterDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); }
-       operator LDKCResult_GossipTimestampFilterDecodeErrorZ() && { LDKCResult_GossipTimestampFilterDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); return res; }
-       ~CResult_GossipTimestampFilterDecodeErrorZ() { CResult_GossipTimestampFilterDecodeErrorZ_free(self); }
-       CResult_GossipTimestampFilterDecodeErrorZ& operator=(CResult_GossipTimestampFilterDecodeErrorZ&& o) { CResult_GossipTimestampFilterDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); return *this; }
-       LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() { return &self; }
-       LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() { return &self; }
-       const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() const { return &self; }
-       const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() const { return &self; }
+       CResult_ReplyChannelRangeDecodeErrorZ(const CResult_ReplyChannelRangeDecodeErrorZ&) = delete;
+       CResult_ReplyChannelRangeDecodeErrorZ(CResult_ReplyChannelRangeDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ReplyChannelRangeDecodeErrorZ)); }
+       CResult_ReplyChannelRangeDecodeErrorZ(LDKCResult_ReplyChannelRangeDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ)); }
+       operator LDKCResult_ReplyChannelRangeDecodeErrorZ() && { LDKCResult_ReplyChannelRangeDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ)); return res; }
+       ~CResult_ReplyChannelRangeDecodeErrorZ() { CResult_ReplyChannelRangeDecodeErrorZ_free(self); }
+       CResult_ReplyChannelRangeDecodeErrorZ& operator=(CResult_ReplyChannelRangeDecodeErrorZ&& o) { CResult_ReplyChannelRangeDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ReplyChannelRangeDecodeErrorZ)); return *this; }
+       LDKCResult_ReplyChannelRangeDecodeErrorZ* operator &() { return &self; }
+       LDKCResult_ReplyChannelRangeDecodeErrorZ* operator ->() { return &self; }
+       const LDKCResult_ReplyChannelRangeDecodeErrorZ* operator &() const { return &self; }
+       const LDKCResult_ReplyChannelRangeDecodeErrorZ* operator ->() const { return &self; }
 };
 class CResult_CommitmentTransactionDecodeErrorZ {
 private:
@@ -4121,20 +4174,20 @@ public:
        const LDKCResult_PingDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_PingDecodeErrorZ* operator ->() const { return &self; }
 };
-class CResult_InvoiceSignOrCreationErrorZ {
+class CResult_GossipTimestampFilterDecodeErrorZ {
 private:
-       LDKCResult_InvoiceSignOrCreationErrorZ self;
+       LDKCResult_GossipTimestampFilterDecodeErrorZ self;
 public:
-       CResult_InvoiceSignOrCreationErrorZ(const CResult_InvoiceSignOrCreationErrorZ&) = delete;
-       CResult_InvoiceSignOrCreationErrorZ(CResult_InvoiceSignOrCreationErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_InvoiceSignOrCreationErrorZ)); }
-       CResult_InvoiceSignOrCreationErrorZ(LDKCResult_InvoiceSignOrCreationErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_InvoiceSignOrCreationErrorZ)); }
-       operator LDKCResult_InvoiceSignOrCreationErrorZ() && { LDKCResult_InvoiceSignOrCreationErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_InvoiceSignOrCreationErrorZ)); return res; }
-       ~CResult_InvoiceSignOrCreationErrorZ() { CResult_InvoiceSignOrCreationErrorZ_free(self); }
-       CResult_InvoiceSignOrCreationErrorZ& operator=(CResult_InvoiceSignOrCreationErrorZ&& o) { CResult_InvoiceSignOrCreationErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_InvoiceSignOrCreationErrorZ)); return *this; }
-       LDKCResult_InvoiceSignOrCreationErrorZ* operator &() { return &self; }
-       LDKCResult_InvoiceSignOrCreationErrorZ* operator ->() { return &self; }
-       const LDKCResult_InvoiceSignOrCreationErrorZ* operator &() const { return &self; }
-       const LDKCResult_InvoiceSignOrCreationErrorZ* operator ->() const { return &self; }
+       CResult_GossipTimestampFilterDecodeErrorZ(const CResult_GossipTimestampFilterDecodeErrorZ&) = delete;
+       CResult_GossipTimestampFilterDecodeErrorZ(CResult_GossipTimestampFilterDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); }
+       CResult_GossipTimestampFilterDecodeErrorZ(LDKCResult_GossipTimestampFilterDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); }
+       operator LDKCResult_GossipTimestampFilterDecodeErrorZ() && { LDKCResult_GossipTimestampFilterDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ)); return res; }
+       ~CResult_GossipTimestampFilterDecodeErrorZ() { CResult_GossipTimestampFilterDecodeErrorZ_free(self); }
+       CResult_GossipTimestampFilterDecodeErrorZ& operator=(CResult_GossipTimestampFilterDecodeErrorZ&& o) { CResult_GossipTimestampFilterDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_GossipTimestampFilterDecodeErrorZ)); return *this; }
+       LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() { return &self; }
+       LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() { return &self; }
+       const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator &() const { return &self; }
+       const LDKCResult_GossipTimestampFilterDecodeErrorZ* operator ->() const { return &self; }
 };
 class CVec_TransactionOutputsZ {
 private:
@@ -4196,20 +4249,20 @@ public:
        const LDKCVec_CVec_u8ZZ* operator &() const { return &self; }
        const LDKCVec_CVec_u8ZZ* operator ->() const { return &self; }
 };
-class COption_FilterZ {
+class CResult_InvoiceSignOrCreationErrorZ {
 private:
-       LDKCOption_FilterZ self;
+       LDKCResult_InvoiceSignOrCreationErrorZ self;
 public:
-       COption_FilterZ(const COption_FilterZ&) = delete;
-       COption_FilterZ(COption_FilterZ&& o) : self(o.self) { memset(&o, 0, sizeof(COption_FilterZ)); }
-       COption_FilterZ(LDKCOption_FilterZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCOption_FilterZ)); }
-       operator LDKCOption_FilterZ() && { LDKCOption_FilterZ res = self; memset(&self, 0, sizeof(LDKCOption_FilterZ)); return res; }
-       ~COption_FilterZ() { COption_FilterZ_free(self); }
-       COption_FilterZ& operator=(COption_FilterZ&& o) { COption_FilterZ_free(self); self = o.self; memset(&o, 0, sizeof(COption_FilterZ)); return *this; }
-       LDKCOption_FilterZ* operator &() { return &self; }
-       LDKCOption_FilterZ* operator ->() { return &self; }
-       const LDKCOption_FilterZ* operator &() const { return &self; }
-       const LDKCOption_FilterZ* operator ->() const { return &self; }
+       CResult_InvoiceSignOrCreationErrorZ(const CResult_InvoiceSignOrCreationErrorZ&) = delete;
+       CResult_InvoiceSignOrCreationErrorZ(CResult_InvoiceSignOrCreationErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_InvoiceSignOrCreationErrorZ)); }
+       CResult_InvoiceSignOrCreationErrorZ(LDKCResult_InvoiceSignOrCreationErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_InvoiceSignOrCreationErrorZ)); }
+       operator LDKCResult_InvoiceSignOrCreationErrorZ() && { LDKCResult_InvoiceSignOrCreationErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_InvoiceSignOrCreationErrorZ)); return res; }
+       ~CResult_InvoiceSignOrCreationErrorZ() { CResult_InvoiceSignOrCreationErrorZ_free(self); }
+       CResult_InvoiceSignOrCreationErrorZ& operator=(CResult_InvoiceSignOrCreationErrorZ&& o) { CResult_InvoiceSignOrCreationErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_InvoiceSignOrCreationErrorZ)); return *this; }
+       LDKCResult_InvoiceSignOrCreationErrorZ* operator &() { return &self; }
+       LDKCResult_InvoiceSignOrCreationErrorZ* operator ->() { return &self; }
+       const LDKCResult_InvoiceSignOrCreationErrorZ* operator &() const { return &self; }
+       const LDKCResult_InvoiceSignOrCreationErrorZ* operator ->() const { return &self; }
 };
 class CResult_SecretKeyErrorZ {
 private:
@@ -4586,6 +4639,21 @@ public:
        const LDKCResult_FundingSignedDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_FundingSignedDecodeErrorZ* operator ->() const { return &self; }
 };
+class COption_FilterZ {
+private:
+       LDKCOption_FilterZ self;
+public:
+       COption_FilterZ(const COption_FilterZ&) = delete;
+       COption_FilterZ(COption_FilterZ&& o) : self(o.self) { memset(&o, 0, sizeof(COption_FilterZ)); }
+       COption_FilterZ(LDKCOption_FilterZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCOption_FilterZ)); }
+       operator LDKCOption_FilterZ() && { LDKCOption_FilterZ res = self; memset(&self, 0, sizeof(LDKCOption_FilterZ)); return res; }
+       ~COption_FilterZ() { COption_FilterZ_free(self); }
+       COption_FilterZ& operator=(COption_FilterZ&& o) { COption_FilterZ_free(self); self = o.self; memset(&o, 0, sizeof(COption_FilterZ)); return *this; }
+       LDKCOption_FilterZ* operator &() { return &self; }
+       LDKCOption_FilterZ* operator ->() { return &self; }
+       const LDKCOption_FilterZ* operator &() const { return &self; }
+       const LDKCOption_FilterZ* operator ->() const { return &self; }
+};
 class CResult_NetworkGraphDecodeErrorZ {
 private:
        LDKCResult_NetworkGraphDecodeErrorZ self;
@@ -4781,6 +4849,21 @@ public:
        const LDKCVec_RouteHintHopZ* operator &() const { return &self; }
        const LDKCVec_RouteHintHopZ* operator ->() const { return &self; }
 };
+class CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+private:
+       LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ self;
+public:
+       CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ(const CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ&) = delete;
+       CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ(CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ)); }
+       CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ)); }
+       operator LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ() && { LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ)); return res; }
+       ~CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ() { CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(self); }
+       CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ& operator=(CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ&& o) { CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ)); return *this; }
+       LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* operator &() { return &self; }
+       LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* operator ->() { return &self; }
+       const LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* operator &() const { return &self; }
+       const LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* operator ->() const { return &self; }
+};
 class C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
 private:
        LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ self;
@@ -4961,20 +5044,20 @@ public:
        const LDKCVec_TxidZ* operator &() const { return &self; }
        const LDKCVec_TxidZ* operator ->() const { return &self; }
 };
-class CResult_NoneMonitorUpdateErrorZ {
+class COption_AccessZ {
 private:
-       LDKCResult_NoneMonitorUpdateErrorZ self;
+       LDKCOption_AccessZ self;
 public:
-       CResult_NoneMonitorUpdateErrorZ(const CResult_NoneMonitorUpdateErrorZ&) = delete;
-       CResult_NoneMonitorUpdateErrorZ(CResult_NoneMonitorUpdateErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NoneMonitorUpdateErrorZ)); }
-       CResult_NoneMonitorUpdateErrorZ(LDKCResult_NoneMonitorUpdateErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NoneMonitorUpdateErrorZ)); }
-       operator LDKCResult_NoneMonitorUpdateErrorZ() && { LDKCResult_NoneMonitorUpdateErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_NoneMonitorUpdateErrorZ)); return res; }
-       ~CResult_NoneMonitorUpdateErrorZ() { CResult_NoneMonitorUpdateErrorZ_free(self); }
-       CResult_NoneMonitorUpdateErrorZ& operator=(CResult_NoneMonitorUpdateErrorZ&& o) { CResult_NoneMonitorUpdateErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_NoneMonitorUpdateErrorZ)); return *this; }
-       LDKCResult_NoneMonitorUpdateErrorZ* operator &() { return &self; }
-       LDKCResult_NoneMonitorUpdateErrorZ* operator ->() { return &self; }
-       const LDKCResult_NoneMonitorUpdateErrorZ* operator &() const { return &self; }
-       const LDKCResult_NoneMonitorUpdateErrorZ* operator ->() const { return &self; }
+       COption_AccessZ(const COption_AccessZ&) = delete;
+       COption_AccessZ(COption_AccessZ&& o) : self(o.self) { memset(&o, 0, sizeof(COption_AccessZ)); }
+       COption_AccessZ(LDKCOption_AccessZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCOption_AccessZ)); }
+       operator LDKCOption_AccessZ() && { LDKCOption_AccessZ res = self; memset(&self, 0, sizeof(LDKCOption_AccessZ)); return res; }
+       ~COption_AccessZ() { COption_AccessZ_free(self); }
+       COption_AccessZ& operator=(COption_AccessZ&& o) { COption_AccessZ_free(self); self = o.self; memset(&o, 0, sizeof(COption_AccessZ)); return *this; }
+       LDKCOption_AccessZ* operator &() { return &self; }
+       LDKCOption_AccessZ* operator ->() { return &self; }
+       const LDKCOption_AccessZ* operator &() const { return &self; }
+       const LDKCOption_AccessZ* operator ->() const { return &self; }
 };
 class CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
 private:
@@ -5051,20 +5134,20 @@ public:
        const LDKC2Tuple_PaymentHashPaymentSecretZ* operator &() const { return &self; }
        const LDKC2Tuple_PaymentHashPaymentSecretZ* operator ->() const { return &self; }
 };
-class COption_AccessZ {
+class CResult_AcceptChannelDecodeErrorZ {
 private:
-       LDKCOption_AccessZ self;
+       LDKCResult_AcceptChannelDecodeErrorZ self;
 public:
-       COption_AccessZ(const COption_AccessZ&) = delete;
-       COption_AccessZ(COption_AccessZ&& o) : self(o.self) { memset(&o, 0, sizeof(COption_AccessZ)); }
-       COption_AccessZ(LDKCOption_AccessZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCOption_AccessZ)); }
-       operator LDKCOption_AccessZ() && { LDKCOption_AccessZ res = self; memset(&self, 0, sizeof(LDKCOption_AccessZ)); return res; }
-       ~COption_AccessZ() { COption_AccessZ_free(self); }
-       COption_AccessZ& operator=(COption_AccessZ&& o) { COption_AccessZ_free(self); self = o.self; memset(&o, 0, sizeof(COption_AccessZ)); return *this; }
-       LDKCOption_AccessZ* operator &() { return &self; }
-       LDKCOption_AccessZ* operator ->() { return &self; }
-       const LDKCOption_AccessZ* operator &() const { return &self; }
-       const LDKCOption_AccessZ* operator ->() const { return &self; }
+       CResult_AcceptChannelDecodeErrorZ(const CResult_AcceptChannelDecodeErrorZ&) = delete;
+       CResult_AcceptChannelDecodeErrorZ(CResult_AcceptChannelDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_AcceptChannelDecodeErrorZ)); }
+       CResult_AcceptChannelDecodeErrorZ(LDKCResult_AcceptChannelDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_AcceptChannelDecodeErrorZ)); }
+       operator LDKCResult_AcceptChannelDecodeErrorZ() && { LDKCResult_AcceptChannelDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_AcceptChannelDecodeErrorZ)); return res; }
+       ~CResult_AcceptChannelDecodeErrorZ() { CResult_AcceptChannelDecodeErrorZ_free(self); }
+       CResult_AcceptChannelDecodeErrorZ& operator=(CResult_AcceptChannelDecodeErrorZ&& o) { CResult_AcceptChannelDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_AcceptChannelDecodeErrorZ)); return *this; }
+       LDKCResult_AcceptChannelDecodeErrorZ* operator &() { return &self; }
+       LDKCResult_AcceptChannelDecodeErrorZ* operator ->() { return &self; }
+       const LDKCResult_AcceptChannelDecodeErrorZ* operator &() const { return &self; }
+       const LDKCResult_AcceptChannelDecodeErrorZ* operator ->() const { return &self; }
 };
 class C2Tuple_BlockHashChannelManagerZ {
 private:
@@ -5096,20 +5179,20 @@ public:
        const LDKCResult_ChannelTransactionParametersDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_ChannelTransactionParametersDecodeErrorZ* operator ->() const { return &self; }
 };
-class CResult_AcceptChannelDecodeErrorZ {
+class CResult_PongDecodeErrorZ {
 private:
-       LDKCResult_AcceptChannelDecodeErrorZ self;
+       LDKCResult_PongDecodeErrorZ self;
 public:
-       CResult_AcceptChannelDecodeErrorZ(const CResult_AcceptChannelDecodeErrorZ&) = delete;
-       CResult_AcceptChannelDecodeErrorZ(CResult_AcceptChannelDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_AcceptChannelDecodeErrorZ)); }
-       CResult_AcceptChannelDecodeErrorZ(LDKCResult_AcceptChannelDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_AcceptChannelDecodeErrorZ)); }
-       operator LDKCResult_AcceptChannelDecodeErrorZ() && { LDKCResult_AcceptChannelDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_AcceptChannelDecodeErrorZ)); return res; }
-       ~CResult_AcceptChannelDecodeErrorZ() { CResult_AcceptChannelDecodeErrorZ_free(self); }
-       CResult_AcceptChannelDecodeErrorZ& operator=(CResult_AcceptChannelDecodeErrorZ&& o) { CResult_AcceptChannelDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_AcceptChannelDecodeErrorZ)); return *this; }
-       LDKCResult_AcceptChannelDecodeErrorZ* operator &() { return &self; }
-       LDKCResult_AcceptChannelDecodeErrorZ* operator ->() { return &self; }
-       const LDKCResult_AcceptChannelDecodeErrorZ* operator &() const { return &self; }
-       const LDKCResult_AcceptChannelDecodeErrorZ* operator ->() const { return &self; }
+       CResult_PongDecodeErrorZ(const CResult_PongDecodeErrorZ&) = delete;
+       CResult_PongDecodeErrorZ(CResult_PongDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PongDecodeErrorZ)); }
+       CResult_PongDecodeErrorZ(LDKCResult_PongDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PongDecodeErrorZ)); }
+       operator LDKCResult_PongDecodeErrorZ() && { LDKCResult_PongDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PongDecodeErrorZ)); return res; }
+       ~CResult_PongDecodeErrorZ() { CResult_PongDecodeErrorZ_free(self); }
+       CResult_PongDecodeErrorZ& operator=(CResult_PongDecodeErrorZ&& o) { CResult_PongDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PongDecodeErrorZ)); return *this; }
+       LDKCResult_PongDecodeErrorZ* operator &() { return &self; }
+       LDKCResult_PongDecodeErrorZ* operator ->() { return &self; }
+       const LDKCResult_PongDecodeErrorZ* operator &() const { return &self; }
+       const LDKCResult_PongDecodeErrorZ* operator ->() const { return &self; }
 };
 class CVec_SignatureZ {
 private:
@@ -5186,20 +5269,20 @@ public:
        const LDKC2Tuple_PaymentHashPaymentIdZ* operator &() const { return &self; }
        const LDKC2Tuple_PaymentHashPaymentIdZ* operator ->() const { return &self; }
 };
-class CResult_StringErrorZ {
+class CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
 private:
-       LDKCResult_StringErrorZ self;
+       LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ self;
 public:
-       CResult_StringErrorZ(const CResult_StringErrorZ&) = delete;
-       CResult_StringErrorZ(CResult_StringErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_StringErrorZ)); }
-       CResult_StringErrorZ(LDKCResult_StringErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_StringErrorZ)); }
-       operator LDKCResult_StringErrorZ() && { LDKCResult_StringErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_StringErrorZ)); return res; }
-       ~CResult_StringErrorZ() { CResult_StringErrorZ_free(self); }
-       CResult_StringErrorZ& operator=(CResult_StringErrorZ&& o) { CResult_StringErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_StringErrorZ)); return *this; }
-       LDKCResult_StringErrorZ* operator &() { return &self; }
-       LDKCResult_StringErrorZ* operator ->() { return &self; }
-       const LDKCResult_StringErrorZ* operator &() const { return &self; }
-       const LDKCResult_StringErrorZ* operator ->() const { return &self; }
+       CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ(const CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ&) = delete;
+       CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ(CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ)); }
+       CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ)); }
+       operator LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ() && { LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ)); return res; }
+       ~CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ() { CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(self); }
+       CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ& operator=(CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ&& o) { CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ)); return *this; }
+       LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* operator &() { return &self; }
+       LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* operator ->() { return &self; }
+       const LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* operator &() const { return &self; }
+       const LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* operator ->() const { return &self; }
 };
 class CResult_NoneErrorZ {
 private:
@@ -5216,6 +5299,21 @@ public:
        const LDKCResult_NoneErrorZ* operator &() const { return &self; }
        const LDKCResult_NoneErrorZ* operator ->() const { return &self; }
 };
+class CResult_StringErrorZ {
+private:
+       LDKCResult_StringErrorZ self;
+public:
+       CResult_StringErrorZ(const CResult_StringErrorZ&) = delete;
+       CResult_StringErrorZ(CResult_StringErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_StringErrorZ)); }
+       CResult_StringErrorZ(LDKCResult_StringErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_StringErrorZ)); }
+       operator LDKCResult_StringErrorZ() && { LDKCResult_StringErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_StringErrorZ)); return res; }
+       ~CResult_StringErrorZ() { CResult_StringErrorZ_free(self); }
+       CResult_StringErrorZ& operator=(CResult_StringErrorZ&& o) { CResult_StringErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_StringErrorZ)); return *this; }
+       LDKCResult_StringErrorZ* operator &() { return &self; }
+       LDKCResult_StringErrorZ* operator ->() { return &self; }
+       const LDKCResult_StringErrorZ* operator &() const { return &self; }
+       const LDKCResult_StringErrorZ* operator ->() const { return &self; }
+};
 class C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
 private:
        LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ self;
@@ -5231,21 +5329,6 @@ public:
        const LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* operator &() const { return &self; }
        const LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* operator ->() const { return &self; }
 };
-class CResult_PongDecodeErrorZ {
-private:
-       LDKCResult_PongDecodeErrorZ self;
-public:
-       CResult_PongDecodeErrorZ(const CResult_PongDecodeErrorZ&) = delete;
-       CResult_PongDecodeErrorZ(CResult_PongDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PongDecodeErrorZ)); }
-       CResult_PongDecodeErrorZ(LDKCResult_PongDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PongDecodeErrorZ)); }
-       operator LDKCResult_PongDecodeErrorZ() && { LDKCResult_PongDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PongDecodeErrorZ)); return res; }
-       ~CResult_PongDecodeErrorZ() { CResult_PongDecodeErrorZ_free(self); }
-       CResult_PongDecodeErrorZ& operator=(CResult_PongDecodeErrorZ&& o) { CResult_PongDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PongDecodeErrorZ)); return *this; }
-       LDKCResult_PongDecodeErrorZ* operator &() { return &self; }
-       LDKCResult_PongDecodeErrorZ* operator ->() { return &self; }
-       const LDKCResult_PongDecodeErrorZ* operator &() const { return &self; }
-       const LDKCResult_PongDecodeErrorZ* operator ->() const { return &self; }
-};
 class CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
 private:
        LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ self;
@@ -5276,6 +5359,21 @@ public:
        const LDKCOption_EventZ* operator &() const { return &self; }
        const LDKCOption_EventZ* operator ->() const { return &self; }
 };
+class CResult_ChannelTypeFeaturesDecodeErrorZ {
+private:
+       LDKCResult_ChannelTypeFeaturesDecodeErrorZ self;
+public:
+       CResult_ChannelTypeFeaturesDecodeErrorZ(const CResult_ChannelTypeFeaturesDecodeErrorZ&) = delete;
+       CResult_ChannelTypeFeaturesDecodeErrorZ(CResult_ChannelTypeFeaturesDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelTypeFeaturesDecodeErrorZ)); }
+       CResult_ChannelTypeFeaturesDecodeErrorZ(LDKCResult_ChannelTypeFeaturesDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ)); }
+       operator LDKCResult_ChannelTypeFeaturesDecodeErrorZ() && { LDKCResult_ChannelTypeFeaturesDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ)); return res; }
+       ~CResult_ChannelTypeFeaturesDecodeErrorZ() { CResult_ChannelTypeFeaturesDecodeErrorZ_free(self); }
+       CResult_ChannelTypeFeaturesDecodeErrorZ& operator=(CResult_ChannelTypeFeaturesDecodeErrorZ&& o) { CResult_ChannelTypeFeaturesDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelTypeFeaturesDecodeErrorZ)); return *this; }
+       LDKCResult_ChannelTypeFeaturesDecodeErrorZ* operator &() { return &self; }
+       LDKCResult_ChannelTypeFeaturesDecodeErrorZ* operator ->() { return &self; }
+       const LDKCResult_ChannelTypeFeaturesDecodeErrorZ* operator &() const { return &self; }
+       const LDKCResult_ChannelTypeFeaturesDecodeErrorZ* operator ->() const { return &self; }
+};
 class CVec_RouteHintZ {
 private:
        LDKCVec_RouteHintZ self;
@@ -5741,6 +5839,21 @@ public:
        const LDKCResult_UpdateFailHTLCDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_UpdateFailHTLCDecodeErrorZ* operator ->() const { return &self; }
 };
+class CResult_PaymentSecretNoneZ {
+private:
+       LDKCResult_PaymentSecretNoneZ self;
+public:
+       CResult_PaymentSecretNoneZ(const CResult_PaymentSecretNoneZ&) = delete;
+       CResult_PaymentSecretNoneZ(CResult_PaymentSecretNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PaymentSecretNoneZ)); }
+       CResult_PaymentSecretNoneZ(LDKCResult_PaymentSecretNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PaymentSecretNoneZ)); }
+       operator LDKCResult_PaymentSecretNoneZ() && { LDKCResult_PaymentSecretNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_PaymentSecretNoneZ)); return res; }
+       ~CResult_PaymentSecretNoneZ() { CResult_PaymentSecretNoneZ_free(self); }
+       CResult_PaymentSecretNoneZ& operator=(CResult_PaymentSecretNoneZ&& o) { CResult_PaymentSecretNoneZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PaymentSecretNoneZ)); return *this; }
+       LDKCResult_PaymentSecretNoneZ* operator &() { return &self; }
+       LDKCResult_PaymentSecretNoneZ* operator ->() { return &self; }
+       const LDKCResult_PaymentSecretNoneZ* operator &() const { return &self; }
+       const LDKCResult_PaymentSecretNoneZ* operator ->() const { return &self; }
+};
 class CResult_ChannelConfigDecodeErrorZ {
 private:
        LDKCResult_ChannelConfigDecodeErrorZ self;
@@ -5966,21 +6079,6 @@ public:
        const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator &() const { return &self; }
        const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator ->() const { return &self; }
 };
-class CResult_NoneNoneZ {
-private:
-       LDKCResult_NoneNoneZ self;
-public:
-       CResult_NoneNoneZ(const CResult_NoneNoneZ&) = delete;
-       CResult_NoneNoneZ(CResult_NoneNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NoneNoneZ)); }
-       CResult_NoneNoneZ(LDKCResult_NoneNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NoneNoneZ)); }
-       operator LDKCResult_NoneNoneZ() && { LDKCResult_NoneNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_NoneNoneZ)); return res; }
-       ~CResult_NoneNoneZ() { CResult_NoneNoneZ_free(self); }
-       CResult_NoneNoneZ& operator=(CResult_NoneNoneZ&& o) { CResult_NoneNoneZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_NoneNoneZ)); return *this; }
-       LDKCResult_NoneNoneZ* operator &() { return &self; }
-       LDKCResult_NoneNoneZ* operator ->() { return &self; }
-       const LDKCResult_NoneNoneZ* operator &() const { return &self; }
-       const LDKCResult_NoneNoneZ* operator ->() const { return &self; }
-};
 class CResult_RouteParametersDecodeErrorZ {
 private:
        LDKCResult_RouteParametersDecodeErrorZ self;
@@ -6011,6 +6109,21 @@ public:
        const LDKCOption_ClosureReasonZ* operator &() const { return &self; }
        const LDKCOption_ClosureReasonZ* operator ->() const { return &self; }
 };
+class CResult_NoneNoneZ {
+private:
+       LDKCResult_NoneNoneZ self;
+public:
+       CResult_NoneNoneZ(const CResult_NoneNoneZ&) = delete;
+       CResult_NoneNoneZ(CResult_NoneNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NoneNoneZ)); }
+       CResult_NoneNoneZ(LDKCResult_NoneNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NoneNoneZ)); }
+       operator LDKCResult_NoneNoneZ() && { LDKCResult_NoneNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_NoneNoneZ)); return res; }
+       ~CResult_NoneNoneZ() { CResult_NoneNoneZ_free(self); }
+       CResult_NoneNoneZ& operator=(CResult_NoneNoneZ&& o) { CResult_NoneNoneZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_NoneNoneZ)); return *this; }
+       LDKCResult_NoneNoneZ* operator &() { return &self; }
+       LDKCResult_NoneNoneZ* operator ->() { return &self; }
+       const LDKCResult_NoneNoneZ* operator &() const { return &self; }
+       const LDKCResult_NoneNoneZ* operator ->() const { return &self; }
+};
 class CVec_APIErrorZ {
 private:
        LDKCVec_APIErrorZ self;
@@ -6221,20 +6334,20 @@ public:
        const LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* operator ->() const { return &self; }
 };
-class CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
+class COption_NoneZ {
 private:
-       LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ self;
+       LDKCOption_NoneZ self;
 public:
-       CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(const CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&) = delete;
-       CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); }
-       CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); }
-       operator LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ() && { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); return res; }
-       ~CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ() { CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(self); }
-       CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ& operator=(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& o) { CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); return *this; }
-       LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() { return &self; }
-       LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() { return &self; }
-       const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() const { return &self; }
-       const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() const { return &self; }
+       COption_NoneZ(const COption_NoneZ&) = delete;
+       COption_NoneZ(COption_NoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(COption_NoneZ)); }
+       COption_NoneZ(LDKCOption_NoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCOption_NoneZ)); }
+       operator LDKCOption_NoneZ() && { LDKCOption_NoneZ res = self; memset(&self, 0, sizeof(LDKCOption_NoneZ)); return res; }
+       ~COption_NoneZ() { COption_NoneZ_free(self); }
+       COption_NoneZ& operator=(COption_NoneZ&& o) { COption_NoneZ_free(self); self = o.self; memset(&o, 0, sizeof(COption_NoneZ)); return *this; }
+       LDKCOption_NoneZ* operator &() { return &self; }
+       LDKCOption_NoneZ* operator ->() { return &self; }
+       const LDKCOption_NoneZ* operator &() const { return &self; }
+       const LDKCOption_NoneZ* operator ->() const { return &self; }
 };
 class CVec_TxOutZ {
 private:
@@ -6251,6 +6364,21 @@ public:
        const LDKCVec_TxOutZ* operator &() const { return &self; }
        const LDKCVec_TxOutZ* operator ->() const { return &self; }
 };
+class CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
+private:
+       LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ self;
+public:
+       CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(const CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&) = delete;
+       CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); }
+       CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); }
+       operator LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ() && { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); return res; }
+       ~CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ() { CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(self); }
+       CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ& operator=(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& o) { CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); return *this; }
+       LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() { return &self; }
+       LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() { return &self; }
+       const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() const { return &self; }
+       const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() const { return &self; }
+};
 class CVec_UpdateFailHTLCZ {
 private:
        LDKCVec_UpdateFailHTLCZ self;
@@ -6345,13 +6473,20 @@ inline void EventsProvider::process_pending_events(struct LDKEventHandler handle
 inline void EventHandler::handle_event(const struct LDKEvent *NONNULL_PTR event) {
        (self.handle_event)(self.this_arg, event);
 }
-inline uint64_t Score::channel_penalty_msat(uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target) {
-       uint64_t ret = (self.channel_penalty_msat)(self.this_arg, short_channel_id, source, target);
+inline uint64_t Score::channel_penalty_msat(uint64_t short_channel_id, uint64_t send_amt_msat, struct LDKCOption_u64Z channel_capacity_msat, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target) {
+       uint64_t ret = (self.channel_penalty_msat)(self.this_arg, short_channel_id, send_amt_msat, channel_capacity_msat, source, target);
        return ret;
 }
 inline void Score::payment_path_failed(struct LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
        (self.payment_path_failed)(self.this_arg, path, short_channel_id);
 }
+inline void Score::payment_path_successful(struct LDKCVec_RouteHopZ path) {
+       (self.payment_path_successful)(self.this_arg, path);
+}
+inline LDK::Score LockableScore::lock() {
+       LDK::Score ret = (self.lock)(self.this_arg);
+       return ret;
+}
 inline LDKPublicKey BaseSign::get_per_commitment_point(uint64_t idx) {
        LDKPublicKey ret = (self.get_per_commitment_point)(self.this_arg, idx);
        return ret;
@@ -6431,6 +6566,10 @@ inline LDK::CResult_RecoverableSignatureNoneZ KeysInterface::sign_invoice(struct
        LDK::CResult_RecoverableSignatureNoneZ ret = (self.sign_invoice)(self.this_arg, invoice_preimage);
        return ret;
 }
+inline LDKThirtyTwoBytes KeysInterface::get_inbound_payment_key_material() {
+       LDKThirtyTwoBytes ret = (self.get_inbound_payment_key_material)(self.this_arg);
+       return ret;
+}
 inline LDK::CResult_COption_TypeZDecodeErrorZ CustomMessageReader::read(uint16_t message_type, struct LDKu8slice buffer) {
        LDK::CResult_COption_TypeZDecodeErrorZ ret = (self.read)(self.this_arg, message_type, buffer);
        return ret;
@@ -6455,12 +6594,19 @@ inline LDK::CResult_PaymentIdPaymentSendFailureZ Payer::send_payment(const struc
        LDK::CResult_PaymentIdPaymentSendFailureZ ret = (self.send_payment)(self.this_arg, route, payment_hash, payment_secret);
        return ret;
 }
+inline LDK::CResult_PaymentIdPaymentSendFailureZ Payer::send_spontaneous_payment(const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage) {
+       LDK::CResult_PaymentIdPaymentSendFailureZ ret = (self.send_spontaneous_payment)(self.this_arg, route, payment_preimage);
+       return ret;
+}
 inline LDK::CResult_NonePaymentSendFailureZ Payer::retry_payment(const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id) {
        LDK::CResult_NonePaymentSendFailureZ ret = (self.retry_payment)(self.this_arg, route, payment_id);
        return ret;
 }
-inline LDK::CResult_RouteLightningErrorZ Router::find_route(struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer) {
-       LDK::CResult_RouteLightningErrorZ ret = (self.find_route)(self.this_arg, payer, params, first_hops, scorer);
+inline void Payer::abandon_payment(struct LDKThirtyTwoBytes payment_id) {
+       (self.abandon_payment)(self.this_arg, payment_id);
+}
+inline LDK::CResult_RouteLightningErrorZ Router::find_route(struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer) {
+       LDK::CResult_RouteLightningErrorZ ret = (self.find_route)(self.this_arg, payer, params, payment_hash, first_hops, scorer);
        return ret;
 }
 inline LDK::CResult_NoneLightningErrorZ CustomMessageHandler::handle_custom_message(struct LDKType msg, struct LDKPublicKey sender_node_id) {
index 68ca65ad131868c9e49f8f56bc5ecf8e193a927f..d2fd004df8ede7e7da902d7586135608462cd622 100644 (file)
@@ -472,7 +472,7 @@ pub enum COption_u32Z {
 }
 impl COption_u32Z {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -595,6 +595,35 @@ impl Clone for CResult_HTLCOutputInCommitmentDecodeErrorZ {
 /// but with all dynamically-allocated buffers duplicated in new buffers.
 pub extern "C" fn CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig: &CResult_HTLCOutputInCommitmentDecodeErrorZ) -> CResult_HTLCOutputInCommitmentDecodeErrorZ { Clone::clone(&orig) }
 #[repr(C)]
+/// An enum which can either contain a  or not
+pub enum COption_NoneZ {
+       /// When we're in this state, this COption_NoneZ contains a 
+       Some,
+       /// When we're in this state, this COption_NoneZ contains nothing
+       None
+}
+impl COption_NoneZ {
+       #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
+               if let Self::None = self { false } else { true }
+       }
+       #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
+               !self.is_some()
+       }
+}
+#[no_mangle]
+/// Constructs a new COption_NoneZ containing a 
+pub extern "C" fn COption_NoneZ_some() -> COption_NoneZ {
+       COption_NoneZ::Some
+}
+#[no_mangle]
+/// Constructs a new COption_NoneZ containing nothing
+pub extern "C" fn COption_NoneZ_none() -> COption_NoneZ {
+       COption_NoneZ::None
+}
+#[no_mangle]
+/// Frees any resources associated with the , if we are in the Some state
+pub extern "C" fn COption_NoneZ_free(_res: COption_NoneZ) { }
+#[repr(C)]
 /// The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
 pub union CResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
        /// A pointer to the contents in the success state.
@@ -1537,6 +1566,23 @@ impl From<crate::c_types::CResultTempl<crate::lightning::ln::script::ShutdownScr
                }
        }
 }
+impl Clone for CResult_ShutdownScriptInvalidShutdownScriptZ {
+       fn clone(&self) -> Self {
+               if self.result_ok {
+                       Self { result_ok: true, contents: CResult_ShutdownScriptInvalidShutdownScriptZPtr {
+                               result: Box::into_raw(Box::new(<crate::lightning::ln::script::ShutdownScript>::clone(unsafe { &*self.contents.result })))
+                       } }
+               } else {
+                       Self { result_ok: false, contents: CResult_ShutdownScriptInvalidShutdownScriptZPtr {
+                               err: Box::into_raw(Box::new(<crate::lightning::ln::script::InvalidShutdownScript>::clone(unsafe { &*self.contents.err })))
+                       } }
+               }
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
+/// but with all dynamically-allocated buffers duplicated in new buffers.
+pub extern "C" fn CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig: &CResult_ShutdownScriptInvalidShutdownScriptZ) -> CResult_ShutdownScriptInvalidShutdownScriptZ { Clone::clone(&orig) }
 #[repr(C)]
 /// The contents of CResult_NoneErrorZ
 pub union CResult_NoneErrorZPtr {
@@ -2066,7 +2112,7 @@ pub enum COption_u64Z {
 }
 impl COption_u64Z {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -2947,7 +2993,7 @@ pub enum COption_C2Tuple_usizeTransactionZZ {
 }
 impl COption_C2Tuple_usizeTransactionZZ {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -2984,7 +3030,7 @@ pub enum COption_ClosureReasonZ {
 }
 impl COption_ClosureReasonZ {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -3117,7 +3163,7 @@ pub enum COption_NetworkUpdateZ {
 }
 impl COption_NetworkUpdateZ {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -3200,7 +3246,7 @@ pub enum COption_EventZ {
 }
 impl COption_EventZ {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -3369,41 +3415,41 @@ impl Clone for CVec_MessageSendEventZ {
        }
 }
 #[repr(C)]
-/// The contents of CResult_InitFeaturesDecodeErrorZ
-pub union CResult_InitFeaturesDecodeErrorZPtr {
+/// The contents of CResult_ScoringParametersDecodeErrorZ
+pub union CResult_ScoringParametersDecodeErrorZPtr {
        /// A pointer to the contents in the success state.
        /// Reading from this pointer when `result_ok` is not set is undefined.
-       pub result: *mut crate::lightning::ln::features::InitFeatures,
+       pub result: *mut crate::lightning::routing::scoring::ScoringParameters,
        /// A pointer to the contents in the error state.
        /// Reading from this pointer when `result_ok` is set is undefined.
        pub err: *mut crate::lightning::ln::msgs::DecodeError,
 }
 #[repr(C)]
-/// A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
-/// containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+/// A CResult_ScoringParametersDecodeErrorZ represents the result of a fallible operation,
+/// containing a crate::lightning::routing::scoring::ScoringParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
 /// `result_ok` indicates the overall state, and the contents are provided via `contents`.
-pub struct CResult_InitFeaturesDecodeErrorZ {
-       /// The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
+pub struct CResult_ScoringParametersDecodeErrorZ {
+       /// The contents of this CResult_ScoringParametersDecodeErrorZ, accessible via either
        /// `err` or `result` depending on the state of `result_ok`.
-       pub contents: CResult_InitFeaturesDecodeErrorZPtr,
-       /// Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
+       pub contents: CResult_ScoringParametersDecodeErrorZPtr,
+       /// Whether this CResult_ScoringParametersDecodeErrorZ represents a success state.
        pub result_ok: bool,
 }
 #[no_mangle]
-/// Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
-pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_ok(o: crate::lightning::ln::features::InitFeatures) -> CResult_InitFeaturesDecodeErrorZ {
-       CResult_InitFeaturesDecodeErrorZ {
-               contents: CResult_InitFeaturesDecodeErrorZPtr {
+/// Creates a new CResult_ScoringParametersDecodeErrorZ in the success state.
+pub extern "C" fn CResult_ScoringParametersDecodeErrorZ_ok(o: crate::lightning::routing::scoring::ScoringParameters) -> CResult_ScoringParametersDecodeErrorZ {
+       CResult_ScoringParametersDecodeErrorZ {
+               contents: CResult_ScoringParametersDecodeErrorZPtr {
                        result: Box::into_raw(Box::new(o)),
                },
                result_ok: true,
        }
 }
 #[no_mangle]
-/// Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
-pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_InitFeaturesDecodeErrorZ {
-       CResult_InitFeaturesDecodeErrorZ {
-               contents: CResult_InitFeaturesDecodeErrorZPtr {
+/// Creates a new CResult_ScoringParametersDecodeErrorZ in the error state.
+pub extern "C" fn CResult_ScoringParametersDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_ScoringParametersDecodeErrorZ {
+       CResult_ScoringParametersDecodeErrorZ {
+               contents: CResult_ScoringParametersDecodeErrorZPtr {
                        err: Box::into_raw(Box::new(e)),
                },
                result_ok: false,
@@ -3411,13 +3457,13 @@ pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_err(e: crate::lightning::ln::
 }
 /// Checks if the given object is currently in the success state
 #[no_mangle]
-pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_is_ok(o: &CResult_InitFeaturesDecodeErrorZ) -> bool {
+pub extern "C" fn CResult_ScoringParametersDecodeErrorZ_is_ok(o: &CResult_ScoringParametersDecodeErrorZ) -> bool {
        o.result_ok
 }
 #[no_mangle]
-/// Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
-pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_free(_res: CResult_InitFeaturesDecodeErrorZ) { }
-impl Drop for CResult_InitFeaturesDecodeErrorZ {
+/// Frees any resources used by the CResult_ScoringParametersDecodeErrorZ.
+pub extern "C" fn CResult_ScoringParametersDecodeErrorZ_free(_res: CResult_ScoringParametersDecodeErrorZ) { }
+impl Drop for CResult_ScoringParametersDecodeErrorZ {
        fn drop(&mut self) {
                if self.result_ok {
                        if unsafe { !(self.contents.result as *mut ()).is_null() } {
@@ -3430,16 +3476,16 @@ impl Drop for CResult_InitFeaturesDecodeErrorZ {
                }
        }
 }
-impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::InitFeatures, crate::lightning::ln::msgs::DecodeError>> for CResult_InitFeaturesDecodeErrorZ {
-       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::InitFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
+impl From<crate::c_types::CResultTempl<crate::lightning::routing::scoring::ScoringParameters, crate::lightning::ln::msgs::DecodeError>> for CResult_ScoringParametersDecodeErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::scoring::ScoringParameters, crate::lightning::ln::msgs::DecodeError>) -> Self {
                let contents = if o.result_ok {
                        let result = unsafe { o.contents.result };
                        unsafe { o.contents.result = std::ptr::null_mut() };
-                       CResult_InitFeaturesDecodeErrorZPtr { result }
+                       CResult_ScoringParametersDecodeErrorZPtr { result }
                } else {
                        let err = unsafe { o.contents.err };
                        unsafe { o.contents.err = std::ptr::null_mut(); }
-                       CResult_InitFeaturesDecodeErrorZPtr { err }
+                       CResult_ScoringParametersDecodeErrorZPtr { err }
                };
                Self {
                        contents,
@@ -3448,41 +3494,41 @@ impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::InitFeatu
        }
 }
 #[repr(C)]
-/// The contents of CResult_NodeFeaturesDecodeErrorZ
-pub union CResult_NodeFeaturesDecodeErrorZPtr {
+/// The contents of CResult_ScorerDecodeErrorZ
+pub union CResult_ScorerDecodeErrorZPtr {
        /// A pointer to the contents in the success state.
        /// Reading from this pointer when `result_ok` is not set is undefined.
-       pub result: *mut crate::lightning::ln::features::NodeFeatures,
+       pub result: *mut crate::lightning::routing::scoring::Scorer,
        /// A pointer to the contents in the error state.
        /// Reading from this pointer when `result_ok` is set is undefined.
        pub err: *mut crate::lightning::ln::msgs::DecodeError,
 }
 #[repr(C)]
-/// A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
-/// containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+/// A CResult_ScorerDecodeErrorZ represents the result of a fallible operation,
+/// containing a crate::lightning::routing::scoring::Scorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
 /// `result_ok` indicates the overall state, and the contents are provided via `contents`.
-pub struct CResult_NodeFeaturesDecodeErrorZ {
-       /// The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
+pub struct CResult_ScorerDecodeErrorZ {
+       /// The contents of this CResult_ScorerDecodeErrorZ, accessible via either
        /// `err` or `result` depending on the state of `result_ok`.
-       pub contents: CResult_NodeFeaturesDecodeErrorZPtr,
-       /// Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
+       pub contents: CResult_ScorerDecodeErrorZPtr,
+       /// Whether this CResult_ScorerDecodeErrorZ represents a success state.
        pub result_ok: bool,
 }
 #[no_mangle]
-/// Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
-pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_ok(o: crate::lightning::ln::features::NodeFeatures) -> CResult_NodeFeaturesDecodeErrorZ {
-       CResult_NodeFeaturesDecodeErrorZ {
-               contents: CResult_NodeFeaturesDecodeErrorZPtr {
+/// Creates a new CResult_ScorerDecodeErrorZ in the success state.
+pub extern "C" fn CResult_ScorerDecodeErrorZ_ok(o: crate::lightning::routing::scoring::Scorer) -> CResult_ScorerDecodeErrorZ {
+       CResult_ScorerDecodeErrorZ {
+               contents: CResult_ScorerDecodeErrorZPtr {
                        result: Box::into_raw(Box::new(o)),
                },
                result_ok: true,
        }
 }
 #[no_mangle]
-/// Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
-pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_NodeFeaturesDecodeErrorZ {
-       CResult_NodeFeaturesDecodeErrorZ {
-               contents: CResult_NodeFeaturesDecodeErrorZPtr {
+/// Creates a new CResult_ScorerDecodeErrorZ in the error state.
+pub extern "C" fn CResult_ScorerDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_ScorerDecodeErrorZ {
+       CResult_ScorerDecodeErrorZ {
+               contents: CResult_ScorerDecodeErrorZPtr {
                        err: Box::into_raw(Box::new(e)),
                },
                result_ok: false,
@@ -3490,13 +3536,13 @@ pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_err(e: crate::lightning::ln::
 }
 /// Checks if the given object is currently in the success state
 #[no_mangle]
-pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_is_ok(o: &CResult_NodeFeaturesDecodeErrorZ) -> bool {
+pub extern "C" fn CResult_ScorerDecodeErrorZ_is_ok(o: &CResult_ScorerDecodeErrorZ) -> bool {
        o.result_ok
 }
 #[no_mangle]
-/// Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
-pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_free(_res: CResult_NodeFeaturesDecodeErrorZ) { }
-impl Drop for CResult_NodeFeaturesDecodeErrorZ {
+/// Frees any resources used by the CResult_ScorerDecodeErrorZ.
+pub extern "C" fn CResult_ScorerDecodeErrorZ_free(_res: CResult_ScorerDecodeErrorZ) { }
+impl Drop for CResult_ScorerDecodeErrorZ {
        fn drop(&mut self) {
                if self.result_ok {
                        if unsafe { !(self.contents.result as *mut ()).is_null() } {
@@ -3509,16 +3555,16 @@ impl Drop for CResult_NodeFeaturesDecodeErrorZ {
                }
        }
 }
-impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::NodeFeatures, crate::lightning::ln::msgs::DecodeError>> for CResult_NodeFeaturesDecodeErrorZ {
-       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::NodeFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
+impl From<crate::c_types::CResultTempl<crate::lightning::routing::scoring::Scorer, crate::lightning::ln::msgs::DecodeError>> for CResult_ScorerDecodeErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::scoring::Scorer, crate::lightning::ln::msgs::DecodeError>) -> Self {
                let contents = if o.result_ok {
                        let result = unsafe { o.contents.result };
                        unsafe { o.contents.result = std::ptr::null_mut() };
-                       CResult_NodeFeaturesDecodeErrorZPtr { result }
+                       CResult_ScorerDecodeErrorZPtr { result }
                } else {
                        let err = unsafe { o.contents.err };
                        unsafe { o.contents.err = std::ptr::null_mut(); }
-                       CResult_NodeFeaturesDecodeErrorZPtr { err }
+                       CResult_ScorerDecodeErrorZPtr { err }
                };
                Self {
                        contents,
@@ -3527,41 +3573,41 @@ impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::NodeFeatu
        }
 }
 #[repr(C)]
-/// The contents of CResult_ChannelFeaturesDecodeErrorZ
-pub union CResult_ChannelFeaturesDecodeErrorZPtr {
+/// The contents of CResult_InitFeaturesDecodeErrorZ
+pub union CResult_InitFeaturesDecodeErrorZPtr {
        /// A pointer to the contents in the success state.
        /// Reading from this pointer when `result_ok` is not set is undefined.
-       pub result: *mut crate::lightning::ln::features::ChannelFeatures,
+       pub result: *mut crate::lightning::ln::features::InitFeatures,
        /// A pointer to the contents in the error state.
        /// Reading from this pointer when `result_ok` is set is undefined.
        pub err: *mut crate::lightning::ln::msgs::DecodeError,
 }
 #[repr(C)]
-/// A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
-/// containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+/// A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
+/// containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
 /// `result_ok` indicates the overall state, and the contents are provided via `contents`.
-pub struct CResult_ChannelFeaturesDecodeErrorZ {
-       /// The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
+pub struct CResult_InitFeaturesDecodeErrorZ {
+       /// The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
        /// `err` or `result` depending on the state of `result_ok`.
-       pub contents: CResult_ChannelFeaturesDecodeErrorZPtr,
-       /// Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
+       pub contents: CResult_InitFeaturesDecodeErrorZPtr,
+       /// Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
        pub result_ok: bool,
 }
 #[no_mangle]
-/// Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
-pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_ok(o: crate::lightning::ln::features::ChannelFeatures) -> CResult_ChannelFeaturesDecodeErrorZ {
-       CResult_ChannelFeaturesDecodeErrorZ {
-               contents: CResult_ChannelFeaturesDecodeErrorZPtr {
+/// Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
+pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_ok(o: crate::lightning::ln::features::InitFeatures) -> CResult_InitFeaturesDecodeErrorZ {
+       CResult_InitFeaturesDecodeErrorZ {
+               contents: CResult_InitFeaturesDecodeErrorZPtr {
                        result: Box::into_raw(Box::new(o)),
                },
                result_ok: true,
        }
 }
 #[no_mangle]
-/// Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
-pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_ChannelFeaturesDecodeErrorZ {
-       CResult_ChannelFeaturesDecodeErrorZ {
-               contents: CResult_ChannelFeaturesDecodeErrorZPtr {
+/// Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
+pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_InitFeaturesDecodeErrorZ {
+       CResult_InitFeaturesDecodeErrorZ {
+               contents: CResult_InitFeaturesDecodeErrorZPtr {
                        err: Box::into_raw(Box::new(e)),
                },
                result_ok: false,
@@ -3569,13 +3615,13 @@ pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_err(e: crate::lightning::l
 }
 /// Checks if the given object is currently in the success state
 #[no_mangle]
-pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_is_ok(o: &CResult_ChannelFeaturesDecodeErrorZ) -> bool {
+pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_is_ok(o: &CResult_InitFeaturesDecodeErrorZ) -> bool {
        o.result_ok
 }
 #[no_mangle]
-/// Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
-pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_free(_res: CResult_ChannelFeaturesDecodeErrorZ) { }
-impl Drop for CResult_ChannelFeaturesDecodeErrorZ {
+/// Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
+pub extern "C" fn CResult_InitFeaturesDecodeErrorZ_free(_res: CResult_InitFeaturesDecodeErrorZ) { }
+impl Drop for CResult_InitFeaturesDecodeErrorZ {
        fn drop(&mut self) {
                if self.result_ok {
                        if unsafe { !(self.contents.result as *mut ()).is_null() } {
@@ -3588,16 +3634,16 @@ impl Drop for CResult_ChannelFeaturesDecodeErrorZ {
                }
        }
 }
-impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::ChannelFeatures, crate::lightning::ln::msgs::DecodeError>> for CResult_ChannelFeaturesDecodeErrorZ {
-       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::ChannelFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
+impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::InitFeatures, crate::lightning::ln::msgs::DecodeError>> for CResult_InitFeaturesDecodeErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::InitFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
                let contents = if o.result_ok {
                        let result = unsafe { o.contents.result };
                        unsafe { o.contents.result = std::ptr::null_mut() };
-                       CResult_ChannelFeaturesDecodeErrorZPtr { result }
+                       CResult_InitFeaturesDecodeErrorZPtr { result }
                } else {
                        let err = unsafe { o.contents.err };
                        unsafe { o.contents.err = std::ptr::null_mut(); }
-                       CResult_ChannelFeaturesDecodeErrorZPtr { err }
+                       CResult_InitFeaturesDecodeErrorZPtr { err }
                };
                Self {
                        contents,
@@ -3606,41 +3652,41 @@ impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::ChannelFe
        }
 }
 #[repr(C)]
-/// The contents of CResult_InvoiceFeaturesDecodeErrorZ
-pub union CResult_InvoiceFeaturesDecodeErrorZPtr {
+/// The contents of CResult_ChannelFeaturesDecodeErrorZ
+pub union CResult_ChannelFeaturesDecodeErrorZPtr {
        /// A pointer to the contents in the success state.
        /// Reading from this pointer when `result_ok` is not set is undefined.
-       pub result: *mut crate::lightning::ln::features::InvoiceFeatures,
+       pub result: *mut crate::lightning::ln::features::ChannelFeatures,
        /// A pointer to the contents in the error state.
        /// Reading from this pointer when `result_ok` is set is undefined.
        pub err: *mut crate::lightning::ln::msgs::DecodeError,
 }
 #[repr(C)]
-/// A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
-/// containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+/// A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
+/// containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
 /// `result_ok` indicates the overall state, and the contents are provided via `contents`.
-pub struct CResult_InvoiceFeaturesDecodeErrorZ {
-       /// The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
+pub struct CResult_ChannelFeaturesDecodeErrorZ {
+       /// The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
        /// `err` or `result` depending on the state of `result_ok`.
-       pub contents: CResult_InvoiceFeaturesDecodeErrorZPtr,
-       /// Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
+       pub contents: CResult_ChannelFeaturesDecodeErrorZPtr,
+       /// Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
        pub result_ok: bool,
 }
 #[no_mangle]
-/// Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
-pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_ok(o: crate::lightning::ln::features::InvoiceFeatures) -> CResult_InvoiceFeaturesDecodeErrorZ {
-       CResult_InvoiceFeaturesDecodeErrorZ {
-               contents: CResult_InvoiceFeaturesDecodeErrorZPtr {
+/// Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
+pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_ok(o: crate::lightning::ln::features::ChannelFeatures) -> CResult_ChannelFeaturesDecodeErrorZ {
+       CResult_ChannelFeaturesDecodeErrorZ {
+               contents: CResult_ChannelFeaturesDecodeErrorZPtr {
                        result: Box::into_raw(Box::new(o)),
                },
                result_ok: true,
        }
 }
 #[no_mangle]
-/// Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
-pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_InvoiceFeaturesDecodeErrorZ {
-       CResult_InvoiceFeaturesDecodeErrorZ {
-               contents: CResult_InvoiceFeaturesDecodeErrorZPtr {
+/// Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
+pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_ChannelFeaturesDecodeErrorZ {
+       CResult_ChannelFeaturesDecodeErrorZ {
+               contents: CResult_ChannelFeaturesDecodeErrorZPtr {
                        err: Box::into_raw(Box::new(e)),
                },
                result_ok: false,
@@ -3648,13 +3694,13 @@ pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_err(e: crate::lightning::l
 }
 /// Checks if the given object is currently in the success state
 #[no_mangle]
-pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o: &CResult_InvoiceFeaturesDecodeErrorZ) -> bool {
+pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_is_ok(o: &CResult_ChannelFeaturesDecodeErrorZ) -> bool {
        o.result_ok
 }
 #[no_mangle]
-/// Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
-pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_free(_res: CResult_InvoiceFeaturesDecodeErrorZ) { }
-impl Drop for CResult_InvoiceFeaturesDecodeErrorZ {
+/// Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
+pub extern "C" fn CResult_ChannelFeaturesDecodeErrorZ_free(_res: CResult_ChannelFeaturesDecodeErrorZ) { }
+impl Drop for CResult_ChannelFeaturesDecodeErrorZ {
        fn drop(&mut self) {
                if self.result_ok {
                        if unsafe { !(self.contents.result as *mut ()).is_null() } {
@@ -3667,16 +3713,16 @@ impl Drop for CResult_InvoiceFeaturesDecodeErrorZ {
                }
        }
 }
-impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::InvoiceFeatures, crate::lightning::ln::msgs::DecodeError>> for CResult_InvoiceFeaturesDecodeErrorZ {
-       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::InvoiceFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
+impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::ChannelFeatures, crate::lightning::ln::msgs::DecodeError>> for CResult_ChannelFeaturesDecodeErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::ChannelFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
                let contents = if o.result_ok {
                        let result = unsafe { o.contents.result };
                        unsafe { o.contents.result = std::ptr::null_mut() };
-                       CResult_InvoiceFeaturesDecodeErrorZPtr { result }
+                       CResult_ChannelFeaturesDecodeErrorZPtr { result }
                } else {
                        let err = unsafe { o.contents.err };
                        unsafe { o.contents.err = std::ptr::null_mut(); }
-                       CResult_InvoiceFeaturesDecodeErrorZPtr { err }
+                       CResult_ChannelFeaturesDecodeErrorZPtr { err }
                };
                Self {
                        contents,
@@ -3685,41 +3731,41 @@ impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::InvoiceFe
        }
 }
 #[repr(C)]
-/// The contents of CResult_ScoringParametersDecodeErrorZ
-pub union CResult_ScoringParametersDecodeErrorZPtr {
+/// The contents of CResult_NodeFeaturesDecodeErrorZ
+pub union CResult_NodeFeaturesDecodeErrorZPtr {
        /// A pointer to the contents in the success state.
        /// Reading from this pointer when `result_ok` is not set is undefined.
-       pub result: *mut crate::lightning::routing::scorer::ScoringParameters,
+       pub result: *mut crate::lightning::ln::features::NodeFeatures,
        /// A pointer to the contents in the error state.
        /// Reading from this pointer when `result_ok` is set is undefined.
        pub err: *mut crate::lightning::ln::msgs::DecodeError,
 }
 #[repr(C)]
-/// A CResult_ScoringParametersDecodeErrorZ represents the result of a fallible operation,
-/// containing a crate::lightning::routing::scorer::ScoringParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
+/// A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
+/// containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
 /// `result_ok` indicates the overall state, and the contents are provided via `contents`.
-pub struct CResult_ScoringParametersDecodeErrorZ {
-       /// The contents of this CResult_ScoringParametersDecodeErrorZ, accessible via either
+pub struct CResult_NodeFeaturesDecodeErrorZ {
+       /// The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
        /// `err` or `result` depending on the state of `result_ok`.
-       pub contents: CResult_ScoringParametersDecodeErrorZPtr,
-       /// Whether this CResult_ScoringParametersDecodeErrorZ represents a success state.
+       pub contents: CResult_NodeFeaturesDecodeErrorZPtr,
+       /// Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
        pub result_ok: bool,
 }
 #[no_mangle]
-/// Creates a new CResult_ScoringParametersDecodeErrorZ in the success state.
-pub extern "C" fn CResult_ScoringParametersDecodeErrorZ_ok(o: crate::lightning::routing::scorer::ScoringParameters) -> CResult_ScoringParametersDecodeErrorZ {
-       CResult_ScoringParametersDecodeErrorZ {
-               contents: CResult_ScoringParametersDecodeErrorZPtr {
+/// Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
+pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_ok(o: crate::lightning::ln::features::NodeFeatures) -> CResult_NodeFeaturesDecodeErrorZ {
+       CResult_NodeFeaturesDecodeErrorZ {
+               contents: CResult_NodeFeaturesDecodeErrorZPtr {
                        result: Box::into_raw(Box::new(o)),
                },
                result_ok: true,
        }
 }
 #[no_mangle]
-/// Creates a new CResult_ScoringParametersDecodeErrorZ in the error state.
-pub extern "C" fn CResult_ScoringParametersDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_ScoringParametersDecodeErrorZ {
-       CResult_ScoringParametersDecodeErrorZ {
-               contents: CResult_ScoringParametersDecodeErrorZPtr {
+/// Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
+pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_NodeFeaturesDecodeErrorZ {
+       CResult_NodeFeaturesDecodeErrorZ {
+               contents: CResult_NodeFeaturesDecodeErrorZPtr {
                        err: Box::into_raw(Box::new(e)),
                },
                result_ok: false,
@@ -3727,13 +3773,13 @@ pub extern "C" fn CResult_ScoringParametersDecodeErrorZ_err(e: crate::lightning:
 }
 /// Checks if the given object is currently in the success state
 #[no_mangle]
-pub extern "C" fn CResult_ScoringParametersDecodeErrorZ_is_ok(o: &CResult_ScoringParametersDecodeErrorZ) -> bool {
+pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_is_ok(o: &CResult_NodeFeaturesDecodeErrorZ) -> bool {
        o.result_ok
 }
 #[no_mangle]
-/// Frees any resources used by the CResult_ScoringParametersDecodeErrorZ.
-pub extern "C" fn CResult_ScoringParametersDecodeErrorZ_free(_res: CResult_ScoringParametersDecodeErrorZ) { }
-impl Drop for CResult_ScoringParametersDecodeErrorZ {
+/// Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
+pub extern "C" fn CResult_NodeFeaturesDecodeErrorZ_free(_res: CResult_NodeFeaturesDecodeErrorZ) { }
+impl Drop for CResult_NodeFeaturesDecodeErrorZ {
        fn drop(&mut self) {
                if self.result_ok {
                        if unsafe { !(self.contents.result as *mut ()).is_null() } {
@@ -3746,16 +3792,16 @@ impl Drop for CResult_ScoringParametersDecodeErrorZ {
                }
        }
 }
-impl From<crate::c_types::CResultTempl<crate::lightning::routing::scorer::ScoringParameters, crate::lightning::ln::msgs::DecodeError>> for CResult_ScoringParametersDecodeErrorZ {
-       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::scorer::ScoringParameters, crate::lightning::ln::msgs::DecodeError>) -> Self {
+impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::NodeFeatures, crate::lightning::ln::msgs::DecodeError>> for CResult_NodeFeaturesDecodeErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::NodeFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
                let contents = if o.result_ok {
                        let result = unsafe { o.contents.result };
                        unsafe { o.contents.result = std::ptr::null_mut() };
-                       CResult_ScoringParametersDecodeErrorZPtr { result }
+                       CResult_NodeFeaturesDecodeErrorZPtr { result }
                } else {
                        let err = unsafe { o.contents.err };
                        unsafe { o.contents.err = std::ptr::null_mut(); }
-                       CResult_ScoringParametersDecodeErrorZPtr { err }
+                       CResult_NodeFeaturesDecodeErrorZPtr { err }
                };
                Self {
                        contents,
@@ -3764,41 +3810,41 @@ impl From<crate::c_types::CResultTempl<crate::lightning::routing::scorer::Scorin
        }
 }
 #[repr(C)]
-/// The contents of CResult_ScorerDecodeErrorZ
-pub union CResult_ScorerDecodeErrorZPtr {
+/// The contents of CResult_InvoiceFeaturesDecodeErrorZ
+pub union CResult_InvoiceFeaturesDecodeErrorZPtr {
        /// A pointer to the contents in the success state.
        /// Reading from this pointer when `result_ok` is not set is undefined.
-       pub result: *mut crate::lightning::routing::scorer::Scorer,
+       pub result: *mut crate::lightning::ln::features::InvoiceFeatures,
        /// A pointer to the contents in the error state.
        /// Reading from this pointer when `result_ok` is set is undefined.
        pub err: *mut crate::lightning::ln::msgs::DecodeError,
 }
 #[repr(C)]
-/// A CResult_ScorerDecodeErrorZ represents the result of a fallible operation,
-/// containing a crate::lightning::routing::scorer::Scorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
+/// A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
+/// containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
 /// `result_ok` indicates the overall state, and the contents are provided via `contents`.
-pub struct CResult_ScorerDecodeErrorZ {
-       /// The contents of this CResult_ScorerDecodeErrorZ, accessible via either
+pub struct CResult_InvoiceFeaturesDecodeErrorZ {
+       /// The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
        /// `err` or `result` depending on the state of `result_ok`.
-       pub contents: CResult_ScorerDecodeErrorZPtr,
-       /// Whether this CResult_ScorerDecodeErrorZ represents a success state.
+       pub contents: CResult_InvoiceFeaturesDecodeErrorZPtr,
+       /// Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
        pub result_ok: bool,
 }
 #[no_mangle]
-/// Creates a new CResult_ScorerDecodeErrorZ in the success state.
-pub extern "C" fn CResult_ScorerDecodeErrorZ_ok(o: crate::lightning::routing::scorer::Scorer) -> CResult_ScorerDecodeErrorZ {
-       CResult_ScorerDecodeErrorZ {
-               contents: CResult_ScorerDecodeErrorZPtr {
+/// Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
+pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_ok(o: crate::lightning::ln::features::InvoiceFeatures) -> CResult_InvoiceFeaturesDecodeErrorZ {
+       CResult_InvoiceFeaturesDecodeErrorZ {
+               contents: CResult_InvoiceFeaturesDecodeErrorZPtr {
                        result: Box::into_raw(Box::new(o)),
                },
                result_ok: true,
        }
 }
 #[no_mangle]
-/// Creates a new CResult_ScorerDecodeErrorZ in the error state.
-pub extern "C" fn CResult_ScorerDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_ScorerDecodeErrorZ {
-       CResult_ScorerDecodeErrorZ {
-               contents: CResult_ScorerDecodeErrorZPtr {
+/// Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
+pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_InvoiceFeaturesDecodeErrorZ {
+       CResult_InvoiceFeaturesDecodeErrorZ {
+               contents: CResult_InvoiceFeaturesDecodeErrorZPtr {
                        err: Box::into_raw(Box::new(e)),
                },
                result_ok: false,
@@ -3806,13 +3852,13 @@ pub extern "C" fn CResult_ScorerDecodeErrorZ_err(e: crate::lightning::ln::msgs::
 }
 /// Checks if the given object is currently in the success state
 #[no_mangle]
-pub extern "C" fn CResult_ScorerDecodeErrorZ_is_ok(o: &CResult_ScorerDecodeErrorZ) -> bool {
+pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o: &CResult_InvoiceFeaturesDecodeErrorZ) -> bool {
        o.result_ok
 }
 #[no_mangle]
-/// Frees any resources used by the CResult_ScorerDecodeErrorZ.
-pub extern "C" fn CResult_ScorerDecodeErrorZ_free(_res: CResult_ScorerDecodeErrorZ) { }
-impl Drop for CResult_ScorerDecodeErrorZ {
+/// Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
+pub extern "C" fn CResult_InvoiceFeaturesDecodeErrorZ_free(_res: CResult_InvoiceFeaturesDecodeErrorZ) { }
+impl Drop for CResult_InvoiceFeaturesDecodeErrorZ {
        fn drop(&mut self) {
                if self.result_ok {
                        if unsafe { !(self.contents.result as *mut ()).is_null() } {
@@ -3825,16 +3871,95 @@ impl Drop for CResult_ScorerDecodeErrorZ {
                }
        }
 }
-impl From<crate::c_types::CResultTempl<crate::lightning::routing::scorer::Scorer, crate::lightning::ln::msgs::DecodeError>> for CResult_ScorerDecodeErrorZ {
-       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::routing::scorer::Scorer, crate::lightning::ln::msgs::DecodeError>) -> Self {
+impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::InvoiceFeatures, crate::lightning::ln::msgs::DecodeError>> for CResult_InvoiceFeaturesDecodeErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::InvoiceFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
                let contents = if o.result_ok {
                        let result = unsafe { o.contents.result };
                        unsafe { o.contents.result = std::ptr::null_mut() };
-                       CResult_ScorerDecodeErrorZPtr { result }
+                       CResult_InvoiceFeaturesDecodeErrorZPtr { result }
                } else {
                        let err = unsafe { o.contents.err };
                        unsafe { o.contents.err = std::ptr::null_mut(); }
-                       CResult_ScorerDecodeErrorZPtr { err }
+                       CResult_InvoiceFeaturesDecodeErrorZPtr { err }
+               };
+               Self {
+                       contents,
+                       result_ok: o.result_ok,
+               }
+       }
+}
+#[repr(C)]
+/// The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
+pub union CResult_ChannelTypeFeaturesDecodeErrorZPtr {
+       /// A pointer to the contents in the success state.
+       /// Reading from this pointer when `result_ok` is not set is undefined.
+       pub result: *mut crate::lightning::ln::features::ChannelTypeFeatures,
+       /// A pointer to the contents in the error state.
+       /// Reading from this pointer when `result_ok` is set is undefined.
+       pub err: *mut crate::lightning::ln::msgs::DecodeError,
+}
+#[repr(C)]
+/// A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
+/// containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+/// `result_ok` indicates the overall state, and the contents are provided via `contents`.
+pub struct CResult_ChannelTypeFeaturesDecodeErrorZ {
+       /// The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
+       /// `err` or `result` depending on the state of `result_ok`.
+       pub contents: CResult_ChannelTypeFeaturesDecodeErrorZPtr,
+       /// Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
+       pub result_ok: bool,
+}
+#[no_mangle]
+/// Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
+pub extern "C" fn CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o: crate::lightning::ln::features::ChannelTypeFeatures) -> CResult_ChannelTypeFeaturesDecodeErrorZ {
+       CResult_ChannelTypeFeaturesDecodeErrorZ {
+               contents: CResult_ChannelTypeFeaturesDecodeErrorZPtr {
+                       result: Box::into_raw(Box::new(o)),
+               },
+               result_ok: true,
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
+pub extern "C" fn CResult_ChannelTypeFeaturesDecodeErrorZ_err(e: crate::lightning::ln::msgs::DecodeError) -> CResult_ChannelTypeFeaturesDecodeErrorZ {
+       CResult_ChannelTypeFeaturesDecodeErrorZ {
+               contents: CResult_ChannelTypeFeaturesDecodeErrorZPtr {
+                       err: Box::into_raw(Box::new(e)),
+               },
+               result_ok: false,
+       }
+}
+/// Checks if the given object is currently in the success state
+#[no_mangle]
+pub extern "C" fn CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o: &CResult_ChannelTypeFeaturesDecodeErrorZ) -> bool {
+       o.result_ok
+}
+#[no_mangle]
+/// Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
+pub extern "C" fn CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res: CResult_ChannelTypeFeaturesDecodeErrorZ) { }
+impl Drop for CResult_ChannelTypeFeaturesDecodeErrorZ {
+       fn drop(&mut self) {
+               if self.result_ok {
+                       if unsafe { !(self.contents.result as *mut ()).is_null() } {
+                               let _ = unsafe { Box::from_raw(self.contents.result) };
+                       }
+               } else {
+                       if unsafe { !(self.contents.err as *mut ()).is_null() } {
+                               let _ = unsafe { Box::from_raw(self.contents.err) };
+                       }
+               }
+       }
+}
+impl From<crate::c_types::CResultTempl<crate::lightning::ln::features::ChannelTypeFeatures, crate::lightning::ln::msgs::DecodeError>> for CResult_ChannelTypeFeaturesDecodeErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::lightning::ln::features::ChannelTypeFeatures, crate::lightning::ln::msgs::DecodeError>) -> Self {
+               let contents = if o.result_ok {
+                       let result = unsafe { o.contents.result };
+                       unsafe { o.contents.result = std::ptr::null_mut() };
+                       CResult_ChannelTypeFeaturesDecodeErrorZPtr { result }
+               } else {
+                       let err = unsafe { o.contents.err };
+                       unsafe { o.contents.err = std::ptr::null_mut(); }
+                       CResult_ChannelTypeFeaturesDecodeErrorZPtr { err }
                };
                Self {
                        contents,
@@ -5208,7 +5333,7 @@ pub enum COption_u16Z {
 }
 impl COption_u16Z {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -5929,6 +6054,286 @@ pub extern "C" fn C2Tuple_PaymentHashPaymentSecretZ_new(a: crate::c_types::Thirt
 /// Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
 pub extern "C" fn C2Tuple_PaymentHashPaymentSecretZ_free(_res: C2Tuple_PaymentHashPaymentSecretZ) { }
 #[repr(C)]
+/// The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
+pub union CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
+       /// A pointer to the contents in the success state.
+       /// Reading from this pointer when `result_ok` is not set is undefined.
+       pub result: *mut crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ,
+       /// Note that this value is always NULL, as there are no contents in the Err variant
+       pub err: *mut std::ffi::c_void,
+}
+#[repr(C)]
+/// A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
+/// containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
+/// `result_ok` indicates the overall state, and the contents are provided via `contents`.
+pub struct CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+       /// The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
+       /// `err` or `result` depending on the state of `result_ok`.
+       pub contents: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr,
+       /// Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
+       pub result_ok: bool,
+}
+#[no_mangle]
+/// Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o: crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ) -> CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+       CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+               contents: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
+                       result: Box::into_raw(Box::new(o)),
+               },
+               result_ok: true,
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() -> CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+       CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+               contents: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
+                       err: std::ptr::null_mut(),
+               },
+               result_ok: false,
+       }
+}
+/// Checks if the given object is currently in the success state
+#[no_mangle]
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o: &CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ) -> bool {
+       o.result_ok
+}
+#[no_mangle]
+/// Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ) { }
+impl Drop for CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+       fn drop(&mut self) {
+               if self.result_ok {
+                       if unsafe { !(self.contents.result as *mut ()).is_null() } {
+                               let _ = unsafe { Box::from_raw(self.contents.result) };
+                       }
+               } else {
+               }
+       }
+}
+impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ, ()>> for CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ, ()>) -> Self {
+               let contents = if o.result_ok {
+                       let result = unsafe { o.contents.result };
+                       unsafe { o.contents.result = std::ptr::null_mut() };
+                       CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr { result }
+               } else {
+                       let _ = unsafe { Box::from_raw(o.contents.err) };
+                       o.contents.err = std::ptr::null_mut();
+                       CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr { err: std::ptr::null_mut() }
+               };
+               Self {
+                       contents,
+                       result_ok: o.result_ok,
+               }
+       }
+}
+impl Clone for CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+       fn clone(&self) -> Self {
+               if self.result_ok {
+                       Self { result_ok: true, contents: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
+                               result: Box::into_raw(Box::new(<crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ>::clone(unsafe { &*self.contents.result })))
+                       } }
+               } else {
+                       Self { result_ok: false, contents: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
+                               err: std::ptr::null_mut()
+                       } }
+               }
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
+/// but with all dynamically-allocated buffers duplicated in new buffers.
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig: &CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ) -> CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ { Clone::clone(&orig) }
+#[repr(C)]
+/// The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
+pub union CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
+       /// A pointer to the contents in the success state.
+       /// Reading from this pointer when `result_ok` is not set is undefined.
+       pub result: *mut crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ,
+       /// A pointer to the contents in the error state.
+       /// Reading from this pointer when `result_ok` is set is undefined.
+       pub err: *mut crate::lightning::util::errors::APIError,
+}
+#[repr(C)]
+/// A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
+/// containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
+/// `result_ok` indicates the overall state, and the contents are provided via `contents`.
+pub struct CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+       /// The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
+       /// `err` or `result` depending on the state of `result_ok`.
+       pub contents: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr,
+       /// Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
+       pub result_ok: bool,
+}
+#[no_mangle]
+/// Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o: crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ) -> CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+       CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+               contents: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
+                       result: Box::into_raw(Box::new(o)),
+               },
+               result_ok: true,
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e: crate::lightning::util::errors::APIError) -> CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+       CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+               contents: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
+                       err: Box::into_raw(Box::new(e)),
+               },
+               result_ok: false,
+       }
+}
+/// Checks if the given object is currently in the success state
+#[no_mangle]
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o: &CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ) -> bool {
+       o.result_ok
+}
+#[no_mangle]
+/// Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ) { }
+impl Drop for CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+       fn drop(&mut self) {
+               if self.result_ok {
+                       if unsafe { !(self.contents.result as *mut ()).is_null() } {
+                               let _ = unsafe { Box::from_raw(self.contents.result) };
+                       }
+               } else {
+                       if unsafe { !(self.contents.err as *mut ()).is_null() } {
+                               let _ = unsafe { Box::from_raw(self.contents.err) };
+                       }
+               }
+       }
+}
+impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ, crate::lightning::util::errors::APIError>> for CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ, crate::lightning::util::errors::APIError>) -> Self {
+               let contents = if o.result_ok {
+                       let result = unsafe { o.contents.result };
+                       unsafe { o.contents.result = std::ptr::null_mut() };
+                       CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr { result }
+               } else {
+                       let err = unsafe { o.contents.err };
+                       unsafe { o.contents.err = std::ptr::null_mut(); }
+                       CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr { err }
+               };
+               Self {
+                       contents,
+                       result_ok: o.result_ok,
+               }
+       }
+}
+impl Clone for CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+       fn clone(&self) -> Self {
+               if self.result_ok {
+                       Self { result_ok: true, contents: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
+                               result: Box::into_raw(Box::new(<crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ>::clone(unsafe { &*self.contents.result })))
+                       } }
+               } else {
+                       Self { result_ok: false, contents: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
+                               err: Box::into_raw(Box::new(<crate::lightning::util::errors::APIError>::clone(unsafe { &*self.contents.err })))
+                       } }
+               }
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
+/// but with all dynamically-allocated buffers duplicated in new buffers.
+pub extern "C" fn CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig: &CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ) -> CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ { Clone::clone(&orig) }
+#[repr(C)]
+/// The contents of CResult_PaymentSecretNoneZ
+pub union CResult_PaymentSecretNoneZPtr {
+       /// A pointer to the contents in the success state.
+       /// Reading from this pointer when `result_ok` is not set is undefined.
+       pub result: *mut crate::c_types::ThirtyTwoBytes,
+       /// Note that this value is always NULL, as there are no contents in the Err variant
+       pub err: *mut std::ffi::c_void,
+}
+#[repr(C)]
+/// A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
+/// containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
+/// `result_ok` indicates the overall state, and the contents are provided via `contents`.
+pub struct CResult_PaymentSecretNoneZ {
+       /// The contents of this CResult_PaymentSecretNoneZ, accessible via either
+       /// `err` or `result` depending on the state of `result_ok`.
+       pub contents: CResult_PaymentSecretNoneZPtr,
+       /// Whether this CResult_PaymentSecretNoneZ represents a success state.
+       pub result_ok: bool,
+}
+#[no_mangle]
+/// Creates a new CResult_PaymentSecretNoneZ in the success state.
+pub extern "C" fn CResult_PaymentSecretNoneZ_ok(o: crate::c_types::ThirtyTwoBytes) -> CResult_PaymentSecretNoneZ {
+       CResult_PaymentSecretNoneZ {
+               contents: CResult_PaymentSecretNoneZPtr {
+                       result: Box::into_raw(Box::new(o)),
+               },
+               result_ok: true,
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_PaymentSecretNoneZ in the error state.
+pub extern "C" fn CResult_PaymentSecretNoneZ_err() -> CResult_PaymentSecretNoneZ {
+       CResult_PaymentSecretNoneZ {
+               contents: CResult_PaymentSecretNoneZPtr {
+                       err: std::ptr::null_mut(),
+               },
+               result_ok: false,
+       }
+}
+/// Checks if the given object is currently in the success state
+#[no_mangle]
+pub extern "C" fn CResult_PaymentSecretNoneZ_is_ok(o: &CResult_PaymentSecretNoneZ) -> bool {
+       o.result_ok
+}
+#[no_mangle]
+/// Frees any resources used by the CResult_PaymentSecretNoneZ.
+pub extern "C" fn CResult_PaymentSecretNoneZ_free(_res: CResult_PaymentSecretNoneZ) { }
+impl Drop for CResult_PaymentSecretNoneZ {
+       fn drop(&mut self) {
+               if self.result_ok {
+                       if unsafe { !(self.contents.result as *mut ()).is_null() } {
+                               let _ = unsafe { Box::from_raw(self.contents.result) };
+                       }
+               } else {
+               }
+       }
+}
+impl From<crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, ()>> for CResult_PaymentSecretNoneZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, ()>) -> Self {
+               let contents = if o.result_ok {
+                       let result = unsafe { o.contents.result };
+                       unsafe { o.contents.result = std::ptr::null_mut() };
+                       CResult_PaymentSecretNoneZPtr { result }
+               } else {
+                       let _ = unsafe { Box::from_raw(o.contents.err) };
+                       o.contents.err = std::ptr::null_mut();
+                       CResult_PaymentSecretNoneZPtr { err: std::ptr::null_mut() }
+               };
+               Self {
+                       contents,
+                       result_ok: o.result_ok,
+               }
+       }
+}
+impl Clone for CResult_PaymentSecretNoneZ {
+       fn clone(&self) -> Self {
+               if self.result_ok {
+                       Self { result_ok: true, contents: CResult_PaymentSecretNoneZPtr {
+                               result: Box::into_raw(Box::new(<crate::c_types::ThirtyTwoBytes>::clone(unsafe { &*self.contents.result })))
+                       } }
+               } else {
+                       Self { result_ok: false, contents: CResult_PaymentSecretNoneZPtr {
+                               err: std::ptr::null_mut()
+                       } }
+               }
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
+/// but with all dynamically-allocated buffers duplicated in new buffers.
+pub extern "C" fn CResult_PaymentSecretNoneZ_clone(orig: &CResult_PaymentSecretNoneZ) -> CResult_PaymentSecretNoneZ { Clone::clone(&orig) }
+#[repr(C)]
 /// The contents of CResult_PaymentSecretAPIErrorZ
 pub union CResult_PaymentSecretAPIErrorZPtr {
        /// A pointer to the contents in the success state.
@@ -6025,6 +6430,102 @@ impl Clone for CResult_PaymentSecretAPIErrorZ {
 /// but with all dynamically-allocated buffers duplicated in new buffers.
 pub extern "C" fn CResult_PaymentSecretAPIErrorZ_clone(orig: &CResult_PaymentSecretAPIErrorZ) -> CResult_PaymentSecretAPIErrorZ { Clone::clone(&orig) }
 #[repr(C)]
+/// The contents of CResult_PaymentPreimageAPIErrorZ
+pub union CResult_PaymentPreimageAPIErrorZPtr {
+       /// A pointer to the contents in the success state.
+       /// Reading from this pointer when `result_ok` is not set is undefined.
+       pub result: *mut crate::c_types::ThirtyTwoBytes,
+       /// A pointer to the contents in the error state.
+       /// Reading from this pointer when `result_ok` is set is undefined.
+       pub err: *mut crate::lightning::util::errors::APIError,
+}
+#[repr(C)]
+/// A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
+/// containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
+/// `result_ok` indicates the overall state, and the contents are provided via `contents`.
+pub struct CResult_PaymentPreimageAPIErrorZ {
+       /// The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
+       /// `err` or `result` depending on the state of `result_ok`.
+       pub contents: CResult_PaymentPreimageAPIErrorZPtr,
+       /// Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
+       pub result_ok: bool,
+}
+#[no_mangle]
+/// Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
+pub extern "C" fn CResult_PaymentPreimageAPIErrorZ_ok(o: crate::c_types::ThirtyTwoBytes) -> CResult_PaymentPreimageAPIErrorZ {
+       CResult_PaymentPreimageAPIErrorZ {
+               contents: CResult_PaymentPreimageAPIErrorZPtr {
+                       result: Box::into_raw(Box::new(o)),
+               },
+               result_ok: true,
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
+pub extern "C" fn CResult_PaymentPreimageAPIErrorZ_err(e: crate::lightning::util::errors::APIError) -> CResult_PaymentPreimageAPIErrorZ {
+       CResult_PaymentPreimageAPIErrorZ {
+               contents: CResult_PaymentPreimageAPIErrorZPtr {
+                       err: Box::into_raw(Box::new(e)),
+               },
+               result_ok: false,
+       }
+}
+/// Checks if the given object is currently in the success state
+#[no_mangle]
+pub extern "C" fn CResult_PaymentPreimageAPIErrorZ_is_ok(o: &CResult_PaymentPreimageAPIErrorZ) -> bool {
+       o.result_ok
+}
+#[no_mangle]
+/// Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
+pub extern "C" fn CResult_PaymentPreimageAPIErrorZ_free(_res: CResult_PaymentPreimageAPIErrorZ) { }
+impl Drop for CResult_PaymentPreimageAPIErrorZ {
+       fn drop(&mut self) {
+               if self.result_ok {
+                       if unsafe { !(self.contents.result as *mut ()).is_null() } {
+                               let _ = unsafe { Box::from_raw(self.contents.result) };
+                       }
+               } else {
+                       if unsafe { !(self.contents.err as *mut ()).is_null() } {
+                               let _ = unsafe { Box::from_raw(self.contents.err) };
+                       }
+               }
+       }
+}
+impl From<crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, crate::lightning::util::errors::APIError>> for CResult_PaymentPreimageAPIErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::c_types::ThirtyTwoBytes, crate::lightning::util::errors::APIError>) -> Self {
+               let contents = if o.result_ok {
+                       let result = unsafe { o.contents.result };
+                       unsafe { o.contents.result = std::ptr::null_mut() };
+                       CResult_PaymentPreimageAPIErrorZPtr { result }
+               } else {
+                       let err = unsafe { o.contents.err };
+                       unsafe { o.contents.err = std::ptr::null_mut(); }
+                       CResult_PaymentPreimageAPIErrorZPtr { err }
+               };
+               Self {
+                       contents,
+                       result_ok: o.result_ok,
+               }
+       }
+}
+impl Clone for CResult_PaymentPreimageAPIErrorZ {
+       fn clone(&self) -> Self {
+               if self.result_ok {
+                       Self { result_ok: true, contents: CResult_PaymentPreimageAPIErrorZPtr {
+                               result: Box::into_raw(Box::new(<crate::c_types::ThirtyTwoBytes>::clone(unsafe { &*self.contents.result })))
+                       } }
+               } else {
+                       Self { result_ok: false, contents: CResult_PaymentPreimageAPIErrorZPtr {
+                               err: Box::into_raw(Box::new(<crate::lightning::util::errors::APIError>::clone(unsafe { &*self.contents.err })))
+                       } }
+               }
+       }
+}
+#[no_mangle]
+/// Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
+/// but with all dynamically-allocated buffers duplicated in new buffers.
+pub extern "C" fn CResult_PaymentPreimageAPIErrorZ_clone(orig: &CResult_PaymentPreimageAPIErrorZ) -> CResult_PaymentPreimageAPIErrorZ { Clone::clone(&orig) }
+#[repr(C)]
 /// A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
 /// This corresponds to std::vector in C++
 pub struct CVec_ChannelMonitorZ {
@@ -6373,7 +6874,7 @@ pub enum COption_TypeZ {
 }
 impl COption_TypeZ {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -7792,7 +8293,7 @@ pub enum COption_MonitorEventZ {
 }
 impl COption_MonitorEventZ {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -8011,98 +8512,6 @@ impl Clone for CResult_HTLCUpdateDecodeErrorZ {
 /// but with all dynamically-allocated buffers duplicated in new buffers.
 pub extern "C" fn CResult_HTLCUpdateDecodeErrorZ_clone(orig: &CResult_HTLCUpdateDecodeErrorZ) -> CResult_HTLCUpdateDecodeErrorZ { Clone::clone(&orig) }
 #[repr(C)]
-/// The contents of CResult_NoneMonitorUpdateErrorZ
-pub union CResult_NoneMonitorUpdateErrorZPtr {
-       /// Note that this value is always NULL, as there are no contents in the OK variant
-       pub result: *mut std::ffi::c_void,
-       /// A pointer to the contents in the error state.
-       /// Reading from this pointer when `result_ok` is set is undefined.
-       pub err: *mut crate::lightning::chain::channelmonitor::MonitorUpdateError,
-}
-#[repr(C)]
-/// A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
-/// containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
-/// `result_ok` indicates the overall state, and the contents are provided via `contents`.
-pub struct CResult_NoneMonitorUpdateErrorZ {
-       /// The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
-       /// `err` or `result` depending on the state of `result_ok`.
-       pub contents: CResult_NoneMonitorUpdateErrorZPtr,
-       /// Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
-       pub result_ok: bool,
-}
-#[no_mangle]
-/// Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
-pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_ok() -> CResult_NoneMonitorUpdateErrorZ {
-       CResult_NoneMonitorUpdateErrorZ {
-               contents: CResult_NoneMonitorUpdateErrorZPtr {
-                       result: std::ptr::null_mut(),
-               },
-               result_ok: true,
-       }
-}
-#[no_mangle]
-/// Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
-pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_err(e: crate::lightning::chain::channelmonitor::MonitorUpdateError) -> CResult_NoneMonitorUpdateErrorZ {
-       CResult_NoneMonitorUpdateErrorZ {
-               contents: CResult_NoneMonitorUpdateErrorZPtr {
-                       err: Box::into_raw(Box::new(e)),
-               },
-               result_ok: false,
-       }
-}
-/// Checks if the given object is currently in the success state
-#[no_mangle]
-pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_is_ok(o: &CResult_NoneMonitorUpdateErrorZ) -> bool {
-       o.result_ok
-}
-#[no_mangle]
-/// Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
-pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_free(_res: CResult_NoneMonitorUpdateErrorZ) { }
-impl Drop for CResult_NoneMonitorUpdateErrorZ {
-       fn drop(&mut self) {
-               if self.result_ok {
-               } else {
-                       if unsafe { !(self.contents.err as *mut ()).is_null() } {
-                               let _ = unsafe { Box::from_raw(self.contents.err) };
-                       }
-               }
-       }
-}
-impl From<crate::c_types::CResultTempl<(), crate::lightning::chain::channelmonitor::MonitorUpdateError>> for CResult_NoneMonitorUpdateErrorZ {
-       fn from(mut o: crate::c_types::CResultTempl<(), crate::lightning::chain::channelmonitor::MonitorUpdateError>) -> Self {
-               let contents = if o.result_ok {
-                       let _ = unsafe { Box::from_raw(o.contents.result) };
-                       o.contents.result = std::ptr::null_mut();
-                       CResult_NoneMonitorUpdateErrorZPtr { result: std::ptr::null_mut() }
-               } else {
-                       let err = unsafe { o.contents.err };
-                       unsafe { o.contents.err = std::ptr::null_mut(); }
-                       CResult_NoneMonitorUpdateErrorZPtr { err }
-               };
-               Self {
-                       contents,
-                       result_ok: o.result_ok,
-               }
-       }
-}
-impl Clone for CResult_NoneMonitorUpdateErrorZ {
-       fn clone(&self) -> Self {
-               if self.result_ok {
-                       Self { result_ok: true, contents: CResult_NoneMonitorUpdateErrorZPtr {
-                               result: std::ptr::null_mut()
-                       } }
-               } else {
-                       Self { result_ok: false, contents: CResult_NoneMonitorUpdateErrorZPtr {
-                               err: Box::into_raw(Box::new(<crate::lightning::chain::channelmonitor::MonitorUpdateError>::clone(unsafe { &*self.contents.err })))
-                       } }
-               }
-       }
-}
-#[no_mangle]
-/// Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
-/// but with all dynamically-allocated buffers duplicated in new buffers.
-pub extern "C" fn CResult_NoneMonitorUpdateErrorZ_clone(orig: &CResult_NoneMonitorUpdateErrorZ) -> CResult_NoneMonitorUpdateErrorZ { Clone::clone(&orig) }
-#[repr(C)]
 /// A tuple of 2 elements. See the individual fields for the types contained.
 pub struct C2Tuple_OutPointScriptZ {
        /// The element at position 0
@@ -9639,7 +10048,7 @@ pub enum COption_AccessZ {
 }
 impl COption_AccessZ {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -10294,7 +10703,7 @@ pub enum COption_CVec_NetAddressZZ {
 }
 impl COption_CVec_NetAddressZZ {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
@@ -13778,7 +14187,7 @@ pub enum COption_FilterZ {
 }
 impl COption_FilterZ {
        #[allow(unused)] pub(crate) fn is_some(&self) -> bool {
-               if let Self::Some(_) = self { true } else { false }
+               if let Self::None = self { false } else { true }
        }
        #[allow(unused)] pub(crate) fn is_none(&self) -> bool {
                !self.is_some()
index 98e964ff6efb5b7d20ec7fe419103ee25f98c6f0..472d4d0d15482e30c031720f0ee4de708d53daef 100644 (file)
@@ -404,8 +404,8 @@ pub struct ThreeBytes { /** The three bytes */ pub data: [u8; 3], }
 pub struct FourBytes { /** The four bytes */ pub data: [u8; 4], }
 #[derive(Clone)]
 #[repr(C)]
-/// A 10-byte byte array.
-pub struct TenBytes { /** The ten bytes */ pub data: [u8; 10], }
+/// A 12-byte byte array.
+pub struct TwelveBytes { /** The twelve bytes */ pub data: [u8; 12], }
 #[derive(Clone)]
 #[repr(C)]
 /// A 16-byte byte array.
index b6c13b149147ee890bef477eb6625a0d25182724..b1c180bbf5a130f10244807d809580345a363cce 100644 (file)
@@ -149,12 +149,12 @@ pub struct FeeEstimator {
        pub this_arg: *mut c_void,
        /// Gets estimated satoshis of fee required per 1000 Weight-Units.
        ///
-       /// Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
-       /// don't put us below 1 satoshi-per-byte).
+       /// Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
+       /// round-downs don't put us below 1 satoshi-per-byte).
        ///
-       /// This translates to:
-       ///  * satoshis-per-byte * 250
-       ///  * ceil(satoshis-per-kbyte / 4)
+       /// This method can be implemented with the following unit conversions:
+       ///  * max(satoshis-per-byte * 250, 253)
+       ///  * max(satoshis-per-kbyte / 4, 253)
        #[must_use]
        pub get_est_sat_per_1000_weight: extern "C" fn (this_arg: *const c_void, confirmation_target: crate::lightning::chain::chaininterface::ConfirmationTarget) -> u32,
        /// Frees any resources associated with this object given its this_arg pointer.
index a55bee59db7c5fe89b64d30ce7394b5fad205023..1484bbf60bacfcb5a57f772f334060568df57df2 100644 (file)
@@ -153,97 +153,6 @@ pub extern "C" fn ChannelMonitorUpdate_read(ser: crate::c_types::u8slice) -> cra
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::chain::channelmonitor::ChannelMonitorUpdate { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
-
-use lightning::chain::channelmonitor::MonitorUpdateError as nativeMonitorUpdateErrorImport;
-pub(crate) type nativeMonitorUpdateError = nativeMonitorUpdateErrorImport;
-
-/// General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
-/// inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
-/// means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
-/// corrupted.
-/// Contains a developer-readable error message.
-#[must_use]
-#[repr(C)]
-pub struct MonitorUpdateError {
-       /// 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.
-       pub inner: *mut nativeMonitorUpdateError,
-       /// 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.
-       pub is_owned: bool,
-}
-
-impl Drop for MonitorUpdateError {
-       fn drop(&mut self) {
-               if self.is_owned && !<*mut nativeMonitorUpdateError>::is_null(self.inner) {
-                       let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
-               }
-       }
-}
-/// Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
-#[no_mangle]
-pub extern "C" fn MonitorUpdateError_free(this_obj: MonitorUpdateError) { }
-#[allow(unused)]
-/// Used only if an object of this type is returned as a trait impl by a method
-pub(crate) extern "C" fn MonitorUpdateError_free_void(this_ptr: *mut c_void) {
-       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeMonitorUpdateError); }
-}
-#[allow(unused)]
-impl MonitorUpdateError {
-       pub(crate) fn get_native_ref(&self) -> &'static nativeMonitorUpdateError {
-               unsafe { &*ObjOps::untweak_ptr(self.inner) }
-       }
-       pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeMonitorUpdateError {
-               unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
-       }
-       /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
-       pub(crate) fn take_inner(mut self) -> *mut nativeMonitorUpdateError {
-               assert!(self.is_owned);
-               let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
-               ret
-       }
-}
-#[no_mangle]
-pub extern "C" fn MonitorUpdateError_get_a(this_ptr: &MonitorUpdateError) -> crate::c_types::Str {
-       let mut inner_val = &mut this_ptr.get_native_mut_ref().0;
-       inner_val.into()
-}
-#[no_mangle]
-pub extern "C" fn MonitorUpdateError_set_a(this_ptr: &mut MonitorUpdateError, mut val: crate::c_types::Str) {
-       unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.0 = val.into_str();
-}
-/// Constructs a new MonitorUpdateError given each field
-#[must_use]
-#[no_mangle]
-pub extern "C" fn MonitorUpdateError_new(mut a_arg: crate::c_types::Str) -> MonitorUpdateError {
-       MonitorUpdateError { inner: ObjOps::heap_alloc(lightning::chain::channelmonitor::MonitorUpdateError (
-               a_arg.into_str(),
-       )), is_owned: true }
-}
-impl Clone for MonitorUpdateError {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: if <*mut nativeMonitorUpdateError>::is_null(self.inner) { std::ptr::null_mut() } else {
-                               ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
-                       is_owned: true,
-               }
-       }
-}
-#[allow(unused)]
-/// Used only if an object of this type is returned as a trait impl by a method
-pub(crate) extern "C" fn MonitorUpdateError_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeMonitorUpdateError)).clone() })) as *mut c_void
-}
-#[no_mangle]
-/// Creates a copy of the MonitorUpdateError
-pub extern "C" fn MonitorUpdateError_clone(orig: &MonitorUpdateError) -> MonitorUpdateError {
-       orig.clone()
-}
 /// An event to be processed by the ChannelManager.
 #[must_use]
 #[derive(Clone)]
@@ -839,9 +748,9 @@ pub(crate) extern "C" fn ChannelMonitor_write_void(obj: *const c_void) -> crate:
 /// panics if the given update is not the next update by update_id.
 #[must_use]
 #[no_mangle]
-pub extern "C" fn ChannelMonitor_update_monitor(this_arg: &ChannelMonitor, updates: &crate::lightning::chain::channelmonitor::ChannelMonitorUpdate, broadcaster: &crate::lightning::chain::chaininterface::BroadcasterInterface, fee_estimator: &crate::lightning::chain::chaininterface::FeeEstimator, logger: &crate::lightning::util::logger::Logger) -> crate::c_types::derived::CResult_NoneMonitorUpdateErrorZ {
+pub extern "C" fn ChannelMonitor_update_monitor(this_arg: &ChannelMonitor, updates: &crate::lightning::chain::channelmonitor::ChannelMonitorUpdate, broadcaster: &crate::lightning::chain::chaininterface::BroadcasterInterface, fee_estimator: &crate::lightning::chain::chaininterface::FeeEstimator, logger: &crate::lightning::util::logger::Logger) -> crate::c_types::derived::CResult_NoneNoneZ {
        let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.update_monitor(updates.get_native_ref(), broadcaster, fee_estimator, logger);
-       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::chain::channelmonitor::MonitorUpdateError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
+       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
        local_ret
 }
 
index 360d33ef1fb2d64395b1beb89c2f90c6a01955f5..0841758fba20fe5c6323013f15c7bbcd594c5c47 100644 (file)
@@ -999,6 +999,11 @@ pub struct KeysInterface {
        /// blindly signing the hash.
        #[must_use]
        pub sign_invoice: extern "C" fn (this_arg: *const c_void, invoice_preimage: crate::c_types::derived::CVec_u8Z) -> crate::c_types::derived::CResult_RecoverableSignatureNoneZ,
+       /// Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
+       ///
+       /// This method must return the same value each time it is called.
+       #[must_use]
+       pub get_inbound_payment_key_material: extern "C" fn (this_arg: *const c_void) -> crate::c_types::ThirtyTwoBytes,
        /// Frees any resources associated with this object given its this_arg pointer.
        /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
@@ -1016,6 +1021,7 @@ pub(crate) extern "C" fn KeysInterface_clone_fields(orig: &KeysInterface) -> Key
                get_secure_random_bytes: Clone::clone(&orig.get_secure_random_bytes),
                read_chan_signer: Clone::clone(&orig.read_chan_signer),
                sign_invoice: Clone::clone(&orig.sign_invoice),
+               get_inbound_payment_key_material: Clone::clone(&orig.get_inbound_payment_key_material),
                free: Clone::clone(&orig.free),
        }
 }
@@ -1055,6 +1061,10 @@ impl rustKeysInterface for KeysInterface {
                let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) }).into_rust() }), false => Err( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) })*/ })};
                local_ret
        }
+       fn get_inbound_payment_key_material(&self) -> lightning::chain::keysinterface::KeyMaterial {
+               let mut ret = (self.get_inbound_payment_key_material)(self.this_arg);
+               ::lightning::chain::keysinterface::KeyMaterial(ret.data)
+       }
 }
 
 // We're essentially a pointer already, or at least a set of pointers, so allow us to be used
@@ -1282,6 +1292,15 @@ pub extern "C" fn InMemorySigner_get_channel_parameters(this_arg: &InMemorySigne
        crate::lightning::ln::chan_utils::ChannelTransactionParameters { inner: unsafe { ObjOps::nonnull_ptr_to_inner((ret as *const lightning::ln::chan_utils::ChannelTransactionParameters<>) as *mut _) }, is_owned: false }
 }
 
+/// Whether anchors should be used.
+/// Will panic if ready_channel wasn't called.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn InMemorySigner_opt_anchors(this_arg: &InMemorySigner) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.opt_anchors();
+       ret
+}
+
 /// Sign the single input of spend_tx at index `input_idx` which spends the output
 /// described by descriptor, returning the witness stack for the input.
 ///
@@ -1635,6 +1654,7 @@ pub extern "C" fn KeysManager_as_KeysInterface(this_arg: &KeysManager) -> crate:
                get_secure_random_bytes: KeysManager_KeysInterface_get_secure_random_bytes,
                read_chan_signer: KeysManager_KeysInterface_read_chan_signer,
                sign_invoice: KeysManager_KeysInterface_sign_invoice,
+               get_inbound_payment_key_material: KeysManager_KeysInterface_get_inbound_payment_key_material,
        }
 }
 
@@ -1644,6 +1664,11 @@ extern "C" fn KeysManager_KeysInterface_get_node_secret(this_arg: *const c_void)
        crate::c_types::SecretKey::from_rust(ret)
 }
 #[must_use]
+extern "C" fn KeysManager_KeysInterface_get_inbound_payment_key_material(this_arg: *const c_void) -> crate::c_types::ThirtyTwoBytes {
+       let mut ret = <nativeKeysManager as lightning::chain::keysinterface::KeysInterface<>>::get_inbound_payment_key_material(unsafe { &mut *(this_arg as *mut nativeKeysManager) }, );
+       crate::c_types::ThirtyTwoBytes { data: ret.0 }
+}
+#[must_use]
 extern "C" fn KeysManager_KeysInterface_get_destination_script(this_arg: *const c_void) -> crate::c_types::derived::CVec_u8Z {
        let mut ret = <nativeKeysManager as lightning::chain::keysinterface::KeysInterface<>>::get_destination_script(unsafe { &mut *(this_arg as *mut nativeKeysManager) }, );
        ret.into_bytes().into()
index 519744cc11ebb09f342c110787d6372afd27d1f5..02f7f7b6a2cec40d1b45742b8d159fca6ffd3310 100644 (file)
@@ -15,6 +15,20 @@ use core::convert::Infallible;
 use bitcoin::hashes::Hash;
 use crate::c_types::*;
 
+/// Gets the weight for an HTLC-Success transaction.
+#[no_mangle]
+pub extern "C" fn htlc_success_tx_weight(mut opt_anchors: bool) -> u64 {
+       let mut ret = lightning::ln::chan_utils::htlc_success_tx_weight(opt_anchors);
+       ret
+}
+
+/// Gets the weight for an HTLC-Timeout transaction.
+#[no_mangle]
+pub extern "C" fn htlc_timeout_tx_weight(mut opt_anchors: bool) -> u64 {
+       let mut ret = lightning::ln::chan_utils::htlc_timeout_tx_weight(opt_anchors);
+       ret
+}
+
 /// Build the commitment secret from the seed and the commitment number
 #[no_mangle]
 pub extern "C" fn build_commitment_secret(commitment_seed: *const [u8; 32], mut idx: u64) -> crate::c_types::ThirtyTwoBytes {
@@ -630,8 +644,8 @@ pub extern "C" fn HTLCOutputInCommitment_read(ser: crate::c_types::u8slice) -> c
 /// Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
 /// does not need to have its previous_output_index filled.
 #[no_mangle]
-pub extern "C" fn get_htlc_redeemscript(htlc: &crate::lightning::ln::chan_utils::HTLCOutputInCommitment, keys: &crate::lightning::ln::chan_utils::TxCreationKeys) -> crate::c_types::derived::CVec_u8Z {
-       let mut ret = lightning::ln::chan_utils::get_htlc_redeemscript(htlc.get_native_ref(), keys.get_native_ref());
+pub extern "C" fn get_htlc_redeemscript(htlc: &crate::lightning::ln::chan_utils::HTLCOutputInCommitment, mut opt_anchors: bool, keys: &crate::lightning::ln::chan_utils::TxCreationKeys) -> crate::c_types::derived::CVec_u8Z {
+       let mut ret = lightning::ln::chan_utils::get_htlc_redeemscript(htlc.get_native_ref(), opt_anchors, keys.get_native_ref());
        ret.into_bytes().into()
 }
 
@@ -651,11 +665,23 @@ pub extern "C" fn make_funding_redeemscript(mut broadcaster: crate::c_types::Pub
 /// Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
 /// commitment transaction).
 #[no_mangle]
-pub extern "C" fn build_htlc_transaction(commitment_txid: *const [u8; 32], mut feerate_per_kw: u32, mut contest_delay: u16, htlc: &crate::lightning::ln::chan_utils::HTLCOutputInCommitment, mut broadcaster_delayed_payment_key: crate::c_types::PublicKey, mut revocation_key: crate::c_types::PublicKey) -> crate::c_types::Transaction {
-       let mut ret = lightning::ln::chan_utils::build_htlc_transaction(&::bitcoin::hash_types::Txid::from_slice(&unsafe { &*commitment_txid }[..]).unwrap(), feerate_per_kw, contest_delay, htlc.get_native_ref(), &broadcaster_delayed_payment_key.into_rust(), &revocation_key.into_rust());
+pub extern "C" fn build_htlc_transaction(commitment_txid: *const [u8; 32], mut feerate_per_kw: u32, mut contest_delay: u16, htlc: &crate::lightning::ln::chan_utils::HTLCOutputInCommitment, mut opt_anchors: bool, mut broadcaster_delayed_payment_key: crate::c_types::PublicKey, mut revocation_key: crate::c_types::PublicKey) -> crate::c_types::Transaction {
+       let mut ret = lightning::ln::chan_utils::build_htlc_transaction(&::bitcoin::hash_types::Txid::from_slice(&unsafe { &*commitment_txid }[..]).unwrap(), feerate_per_kw, contest_delay, htlc.get_native_ref(), opt_anchors, &broadcaster_delayed_payment_key.into_rust(), &revocation_key.into_rust());
        crate::c_types::Transaction::from_bitcoin(&ret)
 }
 
+/// Gets the witnessScript for an anchor output from the funding public key.
+/// The witness in the spending input must be:
+/// <BIP 143 funding_signature>
+/// After 16 blocks of confirmation, an alternative satisfying witness could be:
+/// <>
+/// (empty vector required to satisfy compliance with MINIMALIF-standard rule)
+#[no_mangle]
+pub extern "C" fn get_anchor_redeemscript(mut funding_pubkey: crate::c_types::PublicKey) -> crate::c_types::derived::CVec_u8Z {
+       let mut ret = lightning::ln::chan_utils::get_anchor_redeemscript(&funding_pubkey.into_rust());
+       ret.into_bytes().into()
+}
+
 
 use lightning::ln::chan_utils::ChannelTransactionParameters as nativeChannelTransactionParametersImport;
 pub(crate) type nativeChannelTransactionParameters = nativeChannelTransactionParametersImport;
@@ -782,18 +808,33 @@ pub extern "C" fn ChannelTransactionParameters_set_funding_outpoint(this_ptr: &m
        let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) };
        unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.funding_outpoint = local_val;
 }
+/// Are anchors used for this channel.  Boolean is serialization backwards-compatible
+#[no_mangle]
+pub extern "C" fn ChannelTransactionParameters_get_opt_anchors(this_ptr: &ChannelTransactionParameters) -> crate::c_types::derived::COption_NoneZ {
+       let mut inner_val = &mut this_ptr.get_native_mut_ref().opt_anchors;
+       let mut local_inner_val = if inner_val.is_none() { crate::c_types::derived::COption_NoneZ::None } else { crate::c_types::derived::COption_NoneZ::Some /* { () /**/ } */};
+       local_inner_val
+}
+/// Are anchors used for this channel.  Boolean is serialization backwards-compatible
+#[no_mangle]
+pub extern "C" fn ChannelTransactionParameters_set_opt_anchors(this_ptr: &mut ChannelTransactionParameters, mut val: crate::c_types::derived::COption_NoneZ) {
+       let mut local_val = if val.is_some() { Some( { () /*val.take()*/ }) } else { None };
+       unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.opt_anchors = local_val;
+}
 /// Constructs a new ChannelTransactionParameters given each field
 #[must_use]
 #[no_mangle]
-pub extern "C" fn ChannelTransactionParameters_new(mut holder_pubkeys_arg: crate::lightning::ln::chan_utils::ChannelPublicKeys, mut holder_selected_contest_delay_arg: u16, mut is_outbound_from_holder_arg: bool, mut counterparty_parameters_arg: crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters, mut funding_outpoint_arg: crate::lightning::chain::transaction::OutPoint) -> ChannelTransactionParameters {
+pub extern "C" fn ChannelTransactionParameters_new(mut holder_pubkeys_arg: crate::lightning::ln::chan_utils::ChannelPublicKeys, mut holder_selected_contest_delay_arg: u16, mut is_outbound_from_holder_arg: bool, mut counterparty_parameters_arg: crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters, mut funding_outpoint_arg: crate::lightning::chain::transaction::OutPoint, mut opt_anchors_arg: crate::c_types::derived::COption_NoneZ) -> ChannelTransactionParameters {
        let mut local_counterparty_parameters_arg = if counterparty_parameters_arg.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(counterparty_parameters_arg.take_inner()) } }) };
        let mut local_funding_outpoint_arg = if funding_outpoint_arg.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(funding_outpoint_arg.take_inner()) } }) };
+       let mut local_opt_anchors_arg = if opt_anchors_arg.is_some() { Some( { () /*opt_anchors_arg.take()*/ }) } else { None };
        ChannelTransactionParameters { inner: ObjOps::heap_alloc(nativeChannelTransactionParameters {
                holder_pubkeys: *unsafe { Box::from_raw(holder_pubkeys_arg.take_inner()) },
                holder_selected_contest_delay: holder_selected_contest_delay_arg,
                is_outbound_from_holder: is_outbound_from_holder_arg,
                counterparty_parameters: local_counterparty_parameters_arg,
                funding_outpoint: local_funding_outpoint_arg,
+               opt_anchors: local_opt_anchors_arg,
        }), is_owned: true }
 }
 impl Clone for ChannelTransactionParameters {
@@ -1077,6 +1118,14 @@ pub extern "C" fn DirectedChannelTransactionParameters_funding_outpoint(this_arg
        crate::c_types::bitcoin_to_C_outpoint(ret)
 }
 
+/// Whether to use anchors for this channel
+#[must_use]
+#[no_mangle]
+pub extern "C" fn DirectedChannelTransactionParameters_opt_anchors(this_arg: &DirectedChannelTransactionParameters) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.opt_anchors();
+       ret
+}
+
 
 use lightning::ln::chan_utils::HolderCommitmentTransaction as nativeHolderCommitmentTransactionImport;
 pub(crate) type nativeHolderCommitmentTransaction = nativeHolderCommitmentTransactionImport;
@@ -1389,6 +1438,35 @@ impl ClosingTransaction {
                ret
        }
 }
+impl Clone for ClosingTransaction {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if <*mut nativeClosingTransaction>::is_null(self.inner) { std::ptr::null_mut() } else {
+                               ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
+                       is_owned: true,
+               }
+       }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn ClosingTransaction_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeClosingTransaction)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the ClosingTransaction
+pub extern "C" fn ClosingTransaction_clone(orig: &ClosingTransaction) -> ClosingTransaction {
+       orig.clone()
+}
+/// Checks if two ClosingTransactions contain equal inner contents.
+#[no_mangle]
+pub extern "C" fn ClosingTransaction_hash(o: &ClosingTransaction) -> u64 {
+       if o.inner.is_null() { return 0; }
+       // Note that we'd love to use std::collections::hash_map::DefaultHasher but it's not in core
+       #[allow(deprecated)]
+       let mut hasher = core::hash::SipHasher::new();
+       std::hash::Hash::hash(o.get_native_ref(), &mut hasher);
+       std::hash::Hasher::finish(&hasher)
+}
 /// Construct an object of the class
 #[must_use]
 #[no_mangle]
@@ -1769,6 +1847,14 @@ pub extern "C" fn TrustedCommitmentTransaction_keys(this_arg: &TrustedCommitment
        crate::lightning::ln::chan_utils::TxCreationKeys { inner: unsafe { ObjOps::nonnull_ptr_to_inner((ret as *const lightning::ln::chan_utils::TxCreationKeys<>) as *mut _) }, is_owned: false }
 }
 
+/// Should anchors be used.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn TrustedCommitmentTransaction_opt_anchors(this_arg: &TrustedCommitmentTransaction) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.opt_anchors();
+       ret
+}
+
 /// Get a signature for each HTLC which was included in the commitment transaction (ie for
 /// which HTLCOutputInCommitment::transaction_output_index.is_some()).
 ///
index 3141dd484bb73fcdb627b1b240f7cef576264752..ddf271c3c4f875b731e741870d0b9076de1cbde9 100644 (file)
@@ -23,6 +23,15 @@ use core::convert::Infallible;
 use bitcoin::hashes::Hash;
 use crate::c_types::*;
 
+mod inbound_payment {
+
+use std::str::FromStr;
+use std::ffi::c_void;
+use core::convert::Infallible;
+use bitcoin::hashes::Hash;
+use crate::c_types::*;
+
+}
 
 use lightning::ln::channelmanager::ChannelManager as nativeChannelManagerImport;
 pub(crate) type nativeChannelManager = nativeChannelManagerImport<crate::lightning::chain::keysinterface::Sign, crate::lightning::chain::Watch, crate::lightning::chain::chaininterface::BroadcasterInterface, crate::lightning::chain::keysinterface::KeysInterface, crate::lightning::chain::chaininterface::FeeEstimator, crate::lightning::util::logger::Logger>;
@@ -680,11 +689,42 @@ pub extern "C" fn ChannelDetails_get_user_channel_id(this_ptr: &ChannelDetails)
 pub extern "C" fn ChannelDetails_set_user_channel_id(this_ptr: &mut ChannelDetails, mut val: u64) {
        unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.user_channel_id = val;
 }
+/// Our total balance.  This is the amount we would get if we close the channel.
+/// This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+/// amount is not likely to be recoverable on close.
+///
+/// This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+/// balance is not available for inclusion in new outbound HTLCs). This further does not include
+/// any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+/// This does not consider any on-chain fees.
+///
+/// See also [`ChannelDetails::outbound_capacity_msat`]
+#[no_mangle]
+pub extern "C" fn ChannelDetails_get_balance_msat(this_ptr: &ChannelDetails) -> u64 {
+       let mut inner_val = &mut this_ptr.get_native_mut_ref().balance_msat;
+       *inner_val
+}
+/// Our total balance.  This is the amount we would get if we close the channel.
+/// This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+/// amount is not likely to be recoverable on close.
+///
+/// This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+/// balance is not available for inclusion in new outbound HTLCs). This further does not include
+/// any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+/// This does not consider any on-chain fees.
+///
+/// See also [`ChannelDetails::outbound_capacity_msat`]
+#[no_mangle]
+pub extern "C" fn ChannelDetails_set_balance_msat(this_ptr: &mut ChannelDetails, mut val: u64) {
+       unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.balance_msat = val;
+}
 /// The available outbound capacity for sending HTLCs to the remote peer. This does not include
-/// any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+/// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
 /// available for inclusion in new outbound HTLCs). This further does not include any pending
 /// outgoing HTLCs which are awaiting some other resolution to be sent.
 ///
+/// See also [`ChannelDetails::balance_msat`]
+///
 /// This value is not exact. Due to various in-flight changes, feerate changes, and our
 /// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
 /// should be able to spend nearly this amount.
@@ -694,10 +734,12 @@ pub extern "C" fn ChannelDetails_get_outbound_capacity_msat(this_ptr: &ChannelDe
        *inner_val
 }
 /// The available outbound capacity for sending HTLCs to the remote peer. This does not include
-/// any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+/// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
 /// available for inclusion in new outbound HTLCs). This further does not include any pending
 /// outgoing HTLCs which are awaiting some other resolution to be sent.
 ///
+/// See also [`ChannelDetails::balance_msat`]
+///
 /// This value is not exact. Due to various in-flight changes, feerate changes, and our
 /// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
 /// should be able to spend nearly this amount.
@@ -706,7 +748,7 @@ pub extern "C" fn ChannelDetails_set_outbound_capacity_msat(this_ptr: &mut Chann
        unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.outbound_capacity_msat = val;
 }
 /// The available inbound capacity for the remote peer to send HTLCs to us. This does not
-/// include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+/// include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
 /// available for inclusion in new inbound HTLCs).
 /// Note that there are some corner cases not fully handled here, so the actual available
 /// inbound capacity may be slightly higher than this.
@@ -720,7 +762,7 @@ pub extern "C" fn ChannelDetails_get_inbound_capacity_msat(this_ptr: &ChannelDet
        *inner_val
 }
 /// The available inbound capacity for the remote peer to send HTLCs to us. This does not
-/// include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+/// include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
 /// available for inclusion in new inbound HTLCs).
 /// Note that there are some corner cases not fully handled here, so the actual available
 /// inbound capacity may be slightly higher than this.
@@ -855,7 +897,7 @@ pub extern "C" fn ChannelDetails_set_is_public(this_ptr: &mut ChannelDetails, mu
 /// Constructs a new ChannelDetails given each field
 #[must_use]
 #[no_mangle]
-pub extern "C" fn ChannelDetails_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut counterparty_arg: crate::lightning::ln::channelmanager::ChannelCounterparty, mut funding_txo_arg: crate::lightning::chain::transaction::OutPoint, mut short_channel_id_arg: crate::c_types::derived::COption_u64Z, mut channel_value_satoshis_arg: u64, mut unspendable_punishment_reserve_arg: crate::c_types::derived::COption_u64Z, mut user_channel_id_arg: u64, mut outbound_capacity_msat_arg: u64, mut inbound_capacity_msat_arg: u64, mut confirmations_required_arg: crate::c_types::derived::COption_u32Z, mut force_close_spend_delay_arg: crate::c_types::derived::COption_u16Z, mut is_outbound_arg: bool, mut is_funding_locked_arg: bool, mut is_usable_arg: bool, mut is_public_arg: bool) -> ChannelDetails {
+pub extern "C" fn ChannelDetails_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut counterparty_arg: crate::lightning::ln::channelmanager::ChannelCounterparty, mut funding_txo_arg: crate::lightning::chain::transaction::OutPoint, mut short_channel_id_arg: crate::c_types::derived::COption_u64Z, mut channel_value_satoshis_arg: u64, mut unspendable_punishment_reserve_arg: crate::c_types::derived::COption_u64Z, mut user_channel_id_arg: u64, mut balance_msat_arg: u64, mut outbound_capacity_msat_arg: u64, mut inbound_capacity_msat_arg: u64, mut confirmations_required_arg: crate::c_types::derived::COption_u32Z, mut force_close_spend_delay_arg: crate::c_types::derived::COption_u16Z, mut is_outbound_arg: bool, mut is_funding_locked_arg: bool, mut is_usable_arg: bool, mut is_public_arg: bool) -> ChannelDetails {
        let mut local_funding_txo_arg = if funding_txo_arg.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(funding_txo_arg.take_inner()) } }) };
        let mut local_short_channel_id_arg = if short_channel_id_arg.is_some() { Some( { short_channel_id_arg.take() }) } else { None };
        let mut local_unspendable_punishment_reserve_arg = if unspendable_punishment_reserve_arg.is_some() { Some( { unspendable_punishment_reserve_arg.take() }) } else { None };
@@ -869,6 +911,7 @@ pub extern "C" fn ChannelDetails_new(mut channel_id_arg: crate::c_types::ThirtyT
                channel_value_satoshis: channel_value_satoshis_arg,
                unspendable_punishment_reserve: local_unspendable_punishment_reserve_arg,
                user_channel_id: user_channel_id_arg,
+               balance_msat: balance_msat_arg,
                outbound_capacity_msat: outbound_capacity_msat_arg,
                inbound_capacity_msat: inbound_capacity_msat_arg,
                confirmations_required: local_confirmations_required_arg,
@@ -1328,10 +1371,12 @@ pub extern "C" fn ChannelManager_send_payment(this_arg: &ChannelManager, route:
 ///
 /// Errors returned are a superset of those returned from [`send_payment`], so see
 /// [`send_payment`] documentation for more details on errors. This method will also error if the
-/// retry amount puts the payment more than 10% over the payment's total amount, or if the payment
-/// for the given `payment_id` cannot be found (likely due to timeout or success).
+/// retry amount puts the payment more than 10% over the payment's total amount, if the payment
+/// for the given `payment_id` cannot be found (likely due to timeout or success), or if
+/// further retries have been disabled with [`abandon_payment`].
 ///
 /// [`send_payment`]: [`ChannelManager::send_payment`]
+/// [`abandon_payment`]: [`ChannelManager::abandon_payment`]
 #[must_use]
 #[no_mangle]
 pub extern "C" fn ChannelManager_retry_payment(this_arg: &ChannelManager, route: &crate::lightning::routing::router::Route, mut payment_id: crate::c_types::ThirtyTwoBytes) -> crate::c_types::derived::CResult_NonePaymentSendFailureZ {
@@ -1340,6 +1385,25 @@ pub extern "C" fn ChannelManager_retry_payment(this_arg: &ChannelManager, route:
        local_ret
 }
 
+/// Signals that no further retries for the given payment will occur.
+///
+/// After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
+/// will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
+/// an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
+/// pending HTLCs for this payment.
+///
+/// Note that calling this method does *not* prevent a payment from succeeding. You must still
+/// wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
+/// determine the ultimate status of a payment.
+///
+/// [`retry_payment`]: Self::retry_payment
+/// [`Event::PaymentFailed`]: events::Event::PaymentFailed
+/// [`Event::PaymentSent`]: events::Event::PaymentSent
+#[no_mangle]
+pub extern "C" fn ChannelManager_abandon_payment(this_arg: &ChannelManager, mut payment_id: crate::c_types::ThirtyTwoBytes) {
+       unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.abandon_payment(::lightning::ln::channelmanager::PaymentId(payment_id.data))
+}
+
 /// Send a spontaneous payment, which is a payment that does not require the recipient to have
 /// generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
 /// the preimage, it must be a cryptographically secure random value that no intermediate node
@@ -1370,7 +1434,8 @@ pub extern "C" fn ChannelManager_send_spontaneous_payment(this_arg: &ChannelMana
 /// Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
 /// or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
 ///
-/// Panics if a funding transaction has already been provided for this channel.
+/// Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
+/// for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
 ///
 /// May panic if the output found in the funding transaction is duplicative with some other
 /// channel (note that this should be trivially prevented by using unique funding transaction
@@ -1385,6 +1450,7 @@ pub extern "C" fn ChannelManager_send_spontaneous_payment(this_arg: &ChannelMana
 /// create a new channel with a conflicting funding transaction.
 ///
 /// [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
+/// [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
 #[must_use]
 #[no_mangle]
 pub extern "C" fn ChannelManager_funding_transaction_generated(this_arg: &ChannelManager, temporary_channel_id: *const [u8; 32], mut funding_transaction: crate::c_types::Transaction) -> crate::c_types::derived::CResult_NoneAPIErrorZ {
@@ -1453,19 +1519,21 @@ pub extern "C" fn ChannelManager_fail_htlc_backwards(this_arg: &ChannelManager,
        ret
 }
 
-/// Provides a payment preimage in response to a PaymentReceived event, returning true and
-/// generating message events for the net layer to claim the payment, if possible. Thus, you
-/// should probably kick the net layer to go send messages if this returns true!
+/// Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
+/// [`MessageSendEvent`]s needed to claim the payment.
 ///
 /// Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
 /// [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
 /// event matches your expectation. If you fail to do so and call this method, you may provide
 /// the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
 ///
-/// May panic if called except in response to a PaymentReceived event.
+/// Returns whether any HTLCs were claimed, and thus if any new [`MessageSendEvent`]s are now
+/// pending for processing via [`get_and_clear_pending_msg_events`].
 ///
+/// [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
 /// [`create_inbound_payment`]: Self::create_inbound_payment
 /// [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+/// [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
 #[must_use]
 #[no_mangle]
 pub extern "C" fn ChannelManager_claim_funds(this_arg: &ChannelManager, mut payment_preimage: crate::c_types::ThirtyTwoBytes) -> bool {
@@ -1485,7 +1553,7 @@ pub extern "C" fn ChannelManager_get_our_node_id(this_arg: &ChannelManager) -> c
 /// to pay us.
 ///
 /// This differs from [`create_inbound_payment_for_hash`] only in that it generates the
-/// [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
+/// [`PaymentHash`] and [`PaymentPreimage`] for you.
 ///
 /// The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
 /// will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
@@ -1493,16 +1561,42 @@ pub extern "C" fn ChannelManager_get_our_node_id(this_arg: &ChannelManager) -> c
 ///
 /// See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
 ///
+/// Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+/// `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+///
+/// # Note
+///
+/// If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+/// deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+///
+/// Errors if `min_value_msat` is greater than total bitcoin supply.
+///
 /// [`claim_funds`]: Self::claim_funds
 /// [`PaymentReceived`]: events::Event::PaymentReceived
 /// [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
 /// [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
 #[must_use]
 #[no_mangle]
-pub extern "C" fn ChannelManager_create_inbound_payment(this_arg: &ChannelManager, mut min_value_msat: crate::c_types::derived::COption_u64Z, mut invoice_expiry_delta_secs: u32, mut user_payment_id: u64) -> crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ {
+pub extern "C" fn ChannelManager_create_inbound_payment(this_arg: &ChannelManager, mut min_value_msat: crate::c_types::derived::COption_u64Z, mut invoice_expiry_delta_secs: u32) -> crate::c_types::derived::CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
        let mut local_min_value_msat = if min_value_msat.is_some() { Some( { min_value_msat.take() }) } else { None };
-       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.create_inbound_payment(local_min_value_msat, invoice_expiry_delta_secs, user_payment_id);
-       let (mut orig_ret_0, mut orig_ret_1) = ret; let mut local_ret = (crate::c_types::ThirtyTwoBytes { data: orig_ret_0.0 }, crate::c_types::ThirtyTwoBytes { data: orig_ret_1.0 }).into();
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.create_inbound_payment(local_min_value_msat, invoice_expiry_delta_secs);
+       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { let (mut orig_ret_0_0, mut orig_ret_0_1) = o; let mut local_ret_0 = (crate::c_types::ThirtyTwoBytes { data: orig_ret_0_0.0 }, crate::c_types::ThirtyTwoBytes { data: orig_ret_0_1.0 }).into(); local_ret_0 }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
+       local_ret
+}
+
+/// Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
+/// serialized state with LDK node(s) running 0.0.103 and earlier.
+///
+/// # Note
+/// This method is deprecated and will be removed soon.
+///
+/// [`create_inbound_payment`]: Self::create_inbound_payment
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelManager_create_inbound_payment_legacy(this_arg: &ChannelManager, mut min_value_msat: crate::c_types::derived::COption_u64Z, mut invoice_expiry_delta_secs: u32) -> crate::c_types::derived::CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+       let mut local_min_value_msat = if min_value_msat.is_some() { Some( { min_value_msat.take() }) } else { None };
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.create_inbound_payment_legacy(local_min_value_msat, invoice_expiry_delta_secs);
+       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { let (mut orig_ret_0_0, mut orig_ret_0_1) = o; let mut local_ret_0 = (crate::c_types::ThirtyTwoBytes { data: orig_ret_0_0.0 }, crate::c_types::ThirtyTwoBytes { data: orig_ret_0_1.0 }).into(); local_ret_0 }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::util::errors::APIError::native_into(e) }).into() };
        local_ret
 }
 
@@ -1513,14 +1607,9 @@ pub extern "C" fn ChannelManager_create_inbound_payment(this_arg: &ChannelManage
 /// payment secret fetched via this method or [`create_inbound_payment`], and which is at least
 /// the `min_value_msat` provided here, if one is provided.
 ///
-/// The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
-/// method may return an Err if another payment with the same payment_hash is still pending.
-///
-/// `user_payment_id` will be provided back in [`PaymentPurpose::InvoicePayment::user_payment_id`] events to
-/// allow tracking of which events correspond with which calls to this and
-/// [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
-/// copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
-/// with invoice metadata stored elsewhere.
+/// The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
+/// note that LDK will not stop you from registering duplicate payment hashes for inbound
+/// payments.
 ///
 /// `min_value_msat` should be set if the invoice being generated contains a value. Any payment
 /// received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
@@ -1539,23 +1628,56 @@ pub extern "C" fn ChannelManager_create_inbound_payment(this_arg: &ChannelManage
 /// If you need exact expiry semantics, you should enforce them upon receipt of
 /// [`PaymentReceived`].
 ///
-/// Pending inbound payments are stored in memory and in serialized versions of this
-/// [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
-/// space is limited, you may wish to rate-limit inbound payment creation.
-///
 /// May panic if `invoice_expiry_delta_secs` is greater than one year.
 ///
 /// Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
 /// set to at least [`MIN_FINAL_CLTV_EXPIRY`].
 ///
+/// Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+/// `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+///
+/// # Note
+///
+/// If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+/// deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+///
+/// Errors if `min_value_msat` is greater than total bitcoin supply.
+///
 /// [`create_inbound_payment`]: Self::create_inbound_payment
 /// [`PaymentReceived`]: events::Event::PaymentReceived
-/// [`PaymentPurpose::InvoicePayment::user_payment_id`]: events::PaymentPurpose::InvoicePayment::user_payment_id
 #[must_use]
 #[no_mangle]
-pub extern "C" fn ChannelManager_create_inbound_payment_for_hash(this_arg: &ChannelManager, mut payment_hash: crate::c_types::ThirtyTwoBytes, mut min_value_msat: crate::c_types::derived::COption_u64Z, mut invoice_expiry_delta_secs: u32, mut user_payment_id: u64) -> crate::c_types::derived::CResult_PaymentSecretAPIErrorZ {
+pub extern "C" fn ChannelManager_create_inbound_payment_for_hash(this_arg: &ChannelManager, mut payment_hash: crate::c_types::ThirtyTwoBytes, mut min_value_msat: crate::c_types::derived::COption_u64Z, mut invoice_expiry_delta_secs: u32) -> crate::c_types::derived::CResult_PaymentSecretNoneZ {
        let mut local_min_value_msat = if min_value_msat.is_some() { Some( { min_value_msat.take() }) } else { None };
-       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.create_inbound_payment_for_hash(::lightning::ln::PaymentHash(payment_hash.data), local_min_value_msat, invoice_expiry_delta_secs, user_payment_id);
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.create_inbound_payment_for_hash(::lightning::ln::PaymentHash(payment_hash.data), local_min_value_msat, invoice_expiry_delta_secs);
+       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::ThirtyTwoBytes { data: o.0 } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
+       local_ret
+}
+
+/// Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
+/// serialized state with LDK node(s) running 0.0.103 and earlier.
+///
+/// # Note
+/// This method is deprecated and will be removed soon.
+///
+/// [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelManager_create_inbound_payment_for_hash_legacy(this_arg: &ChannelManager, mut payment_hash: crate::c_types::ThirtyTwoBytes, mut min_value_msat: crate::c_types::derived::COption_u64Z, mut invoice_expiry_delta_secs: u32) -> crate::c_types::derived::CResult_PaymentSecretAPIErrorZ {
+       let mut local_min_value_msat = if min_value_msat.is_some() { Some( { min_value_msat.take() }) } else { None };
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.create_inbound_payment_for_hash_legacy(::lightning::ln::PaymentHash(payment_hash.data), local_min_value_msat, invoice_expiry_delta_secs);
+       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::ThirtyTwoBytes { data: o.0 } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::util::errors::APIError::native_into(e) }).into() };
+       local_ret
+}
+
+/// Gets an LDK-generated payment preimage from a payment hash and payment secret that were
+/// previously returned from [`create_inbound_payment`].
+///
+/// [`create_inbound_payment`]: Self::create_inbound_payment
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelManager_get_payment_preimage(this_arg: &ChannelManager, mut payment_hash: crate::c_types::ThirtyTwoBytes, mut payment_secret: crate::c_types::ThirtyTwoBytes) -> crate::c_types::derived::CResult_PaymentPreimageAPIErrorZ {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.get_payment_preimage(::lightning::ln::PaymentHash(payment_hash.data), ::lightning::ln::PaymentSecret(payment_secret.data));
        let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::ThirtyTwoBytes { data: o.0 } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::util::errors::APIError::native_into(e) }).into() };
        local_ret
 }
@@ -1687,7 +1809,8 @@ extern "C" fn ChannelManager_Confirm_transaction_unconfirmed(this_arg: *const c_
 /// indicating whether persistence is necessary. Only one listener on
 /// `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
 /// up.
-/// Note that the feature `allow_wallclock_use` must be enabled to use this function.
+///
+/// Note that this method is not available with the `no-std` feature.
 #[must_use]
 #[no_mangle]
 pub extern "C" fn ChannelManager_await_persistable_update_timeout(this_arg: &ChannelManager, mut max_wait: u64) -> bool {
index 591173e31cf12f5161a30208ccc1a7b2b353b5cf..c0a52b3ee74f39e7df9800b8278ad0614020bdc3 100644 (file)
@@ -72,6 +72,15 @@ pub extern "C" fn InvoiceFeatures_eq(a: &InvoiceFeatures, b: &InvoiceFeatures) -
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
+/// Checks if two ChannelTypeFeaturess contain equal inner contents.
+/// This ignores pointers and is_owned flags and looks at the values in fields.
+/// Two objects with NULL inner values will be considered "equal" here.
+#[no_mangle]
+pub extern "C" fn ChannelTypeFeatures_eq(a: &ChannelTypeFeatures, b: &ChannelTypeFeatures) -> bool {
+       if a.inner == b.inner { return true; }
+       if a.inner.is_null() || b.inner.is_null() { return false; }
+       if a.get_native_ref() == b.get_native_ref() { true } else { false }
+}
 impl Clone for InitFeatures {
        fn clone(&self) -> Self {
                Self {
@@ -148,6 +157,25 @@ pub(crate) extern "C" fn InvoiceFeatures_clone_void(this_ptr: *const c_void) ->
 pub extern "C" fn InvoiceFeatures_clone(orig: &InvoiceFeatures) -> InvoiceFeatures {
        orig.clone()
 }
+impl Clone for ChannelTypeFeatures {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if <*mut nativeChannelTypeFeatures>::is_null(self.inner) { std::ptr::null_mut() } else {
+                               ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
+                       is_owned: true,
+               }
+       }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn ChannelTypeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelTypeFeatures)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the ChannelTypeFeatures
+pub extern "C" fn ChannelTypeFeatures_clone(orig: &ChannelTypeFeatures) -> ChannelTypeFeatures {
+       orig.clone()
+}
 
 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
 pub(crate) type nativeInitFeatures = nativeInitFeaturesImport;
@@ -352,6 +380,66 @@ impl InvoiceFeatures {
                ret
        }
 }
+
+use lightning::ln::features::ChannelTypeFeatures as nativeChannelTypeFeaturesImport;
+pub(crate) type nativeChannelTypeFeatures = nativeChannelTypeFeaturesImport;
+
+/// Features used within the channel_type field in an OpenChannel message.
+///
+/// A channel is always of some known \"type\", describing the transaction formats used and the exact
+/// semantics of our interaction with our peer.
+///
+/// Note that because a channel is a specific type which is proposed by the opener and accepted by
+/// the counterparty, only required features are allowed here.
+///
+/// This is serialized differently from other feature types - it is not prefixed by a length, and
+/// thus must only appear inside a TLV where its length is known in advance.
+#[must_use]
+#[repr(C)]
+pub struct ChannelTypeFeatures {
+       /// 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.
+       pub inner: *mut nativeChannelTypeFeatures,
+       /// 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.
+       pub is_owned: bool,
+}
+
+impl Drop for ChannelTypeFeatures {
+       fn drop(&mut self) {
+               if self.is_owned && !<*mut nativeChannelTypeFeatures>::is_null(self.inner) {
+                       let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
+               }
+       }
+}
+/// Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
+#[no_mangle]
+pub extern "C" fn ChannelTypeFeatures_free(this_obj: ChannelTypeFeatures) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn ChannelTypeFeatures_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeChannelTypeFeatures); }
+}
+#[allow(unused)]
+impl ChannelTypeFeatures {
+       pub(crate) fn get_native_ref(&self) -> &'static nativeChannelTypeFeatures {
+               unsafe { &*ObjOps::untweak_ptr(self.inner) }
+       }
+       pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeChannelTypeFeatures {
+               unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
+       }
+       /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+       pub(crate) fn take_inner(mut self) -> *mut nativeChannelTypeFeatures {
+               assert!(self.is_owned);
+               let ret = ObjOps::untweak_ptr(self.inner);
+               self.inner = std::ptr::null_mut();
+               ret
+       }
+}
 /// Create a blank Features with no features set
 #[must_use]
 #[no_mangle]
@@ -452,27 +540,28 @@ pub extern "C" fn InvoiceFeatures_requires_unknown_bits(this_arg: &InvoiceFeatur
        ret
 }
 
-/// Returns whether the `payment_secret` feature is supported.
+/// Create a blank Features with no features set
 #[must_use]
 #[no_mangle]
-pub extern "C" fn InitFeatures_supports_payment_secret(this_arg: &InitFeatures) -> bool {
-       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
-       ret
+pub extern "C" fn ChannelTypeFeatures_empty() -> ChannelTypeFeatures {
+       let mut ret = lightning::ln::features::ChannelTypeFeatures::empty();
+       ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
 }
 
-/// Returns whether the `payment_secret` feature is supported.
+/// Creates a Features with the bits set which are known by the implementation
 #[must_use]
 #[no_mangle]
-pub extern "C" fn NodeFeatures_supports_payment_secret(this_arg: &NodeFeatures) -> bool {
-       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
-       ret
+pub extern "C" fn ChannelTypeFeatures_known() -> ChannelTypeFeatures {
+       let mut ret = lightning::ln::features::ChannelTypeFeatures::known();
+       ChannelTypeFeatures { inner: ObjOps::heap_alloc(ret), is_owned: true }
 }
 
-/// Returns whether the `payment_secret` feature is supported.
+/// Returns true if this `Features` object contains unknown feature flags which are set as
+/// \"required\".
 #[must_use]
 #[no_mangle]
-pub extern "C" fn InvoiceFeatures_supports_payment_secret(this_arg: &InvoiceFeatures) -> bool {
-       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.supports_payment_secret();
+pub extern "C" fn ChannelTypeFeatures_requires_unknown_bits(this_arg: &ChannelTypeFeatures) -> bool {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.requires_unknown_bits();
        ret
 }
 
@@ -486,13 +575,11 @@ pub(crate) extern "C" fn InitFeatures_write_void(obj: *const c_void) -> crate::c
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInitFeatures) })
 }
 #[no_mangle]
-/// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
-pub extern "C" fn NodeFeatures_write(obj: &NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
-}
-#[no_mangle]
-pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
+/// Read a InitFeatures from a byte array, created by InitFeatures_write
+pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
+       let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
 /// Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
@@ -504,20 +591,20 @@ pub(crate) extern "C" fn ChannelFeatures_write_void(obj: *const c_void) -> crate
        crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelFeatures) })
 }
 #[no_mangle]
-/// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
-pub extern "C" fn InvoiceFeatures_write(obj: &InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
+/// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
+pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
+       let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
+/// Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
+pub extern "C" fn NodeFeatures_write(obj: &NodeFeatures) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
 }
 #[no_mangle]
-/// Read a InitFeatures from a byte array, created by InitFeatures_write
-pub extern "C" fn InitFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitFeaturesDecodeErrorZ {
-       let res: Result<lightning::ln::features::InitFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
-       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::InitFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
-       local_res
+pub(crate) extern "C" fn NodeFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeFeatures) })
 }
 #[no_mangle]
 /// Read a NodeFeatures from a byte array, created by NodeFeatures_write
@@ -527,11 +614,13 @@ pub extern "C" fn NodeFeatures_read(ser: crate::c_types::u8slice) -> crate::c_ty
        local_res
 }
 #[no_mangle]
-/// Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
-pub extern "C" fn ChannelFeatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelFeaturesDecodeErrorZ {
-       let res: Result<lightning::ln::features::ChannelFeatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
-       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::features::ChannelFeatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
-       local_res
+/// Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
+pub extern "C" fn InvoiceFeatures_write(obj: &InvoiceFeatures) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
+}
+#[no_mangle]
+pub(crate) extern "C" fn InvoiceFeatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInvoiceFeatures) })
 }
 #[no_mangle]
 /// Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
@@ -540,3