Skip to content

Commit c151119

Browse files
authored
Merge pull request #88 from TheBlueMatt/main
Try clone'ing the field before skipping exporting a field getter
2 parents 9c6d1f1 + 8e312af commit c151119

File tree

7 files changed

+201
-0
lines changed

7 files changed

+201
-0
lines changed

c-bindings-gen/src/main.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,25 @@ fn writeln_struct<'a, 'b, W: std::io::Write>(w: &mut W, s: &'a syn::ItemStruct,
735735
write!(w, "inner_val").unwrap();
736736
types.write_to_c_conversion_inline_suffix(w, &ref_type, Some(&gen_types), true);
737737
writeln!(w, "\n}}").unwrap();
738+
} else {
739+
// If the type isn't reference-able, but is clonable, export a getter that just clones
740+
if types.understood_c_type(&$field.ty, Some(&gen_types)) {
741+
let mut v = Vec::new();
742+
types.write_c_type(&mut v, &$field.ty, Some(&gen_types), true);
743+
let s = String::from_utf8(v).unwrap();
744+
if types.is_clonable(&s) {
745+
writeln_arg_docs(w, &$field.attrs, "", types, Some(&gen_types), vec![].drain(..), Some(&$field.ty));
746+
writeln!(w, "///\n/// Returns a copy of the field.").unwrap();
747+
write!(w, "#[no_mangle]\npub extern \"C\" fn {}_get_{}(this_ptr: &{}) -> {}", struct_name, $new_name, struct_name, s).unwrap();
748+
write!(w, " {{\n\tlet mut inner_val = this_ptr.get_native_mut_ref().{}.clone();\n\t", $real_name).unwrap();
749+
let local_var = types.write_to_c_conversion_new_var(w, &format_ident!("inner_val"), &$field.ty, Some(&gen_types), true);
750+
if local_var { write!(w, "\n\t").unwrap(); }
751+
types.write_to_c_conversion_inline_prefix(w, &$field.ty, Some(&gen_types), true);
752+
write!(w, "inner_val").unwrap();
753+
types.write_to_c_conversion_inline_suffix(w, &$field.ty, Some(&gen_types), true);
754+
writeln!(w, "\n}}").unwrap();
755+
}
756+
}
738757
}
739758
}
740759

lightning-c-bindings/include/lightning.h

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19563,6 +19563,13 @@ uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelaye
1956319563
*/
1956419564
void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
1956519565

19566+
/**
19567+
* The output which is referenced by the given outpoint
19568+
*
19569+
* Returns a copy of the field.
19570+
*/
19571+
struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19572+
1956619573
/**
1956719574
* The output which is referenced by the given outpoint
1956819575
*/
@@ -19639,6 +19646,13 @@ struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKSt
1963919646
*/
1964019647
void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
1964119648

19649+
/**
19650+
* The output which is referenced by the given outpoint
19651+
*
19652+
* Returns a copy of the field.
19653+
*/
19654+
struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19655+
1964219656
/**
1964319657
* The output which is referenced by the given outpoint
1964419658
*/
@@ -22639,6 +22653,13 @@ struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSig
2263922653
*/
2264022654
void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
2264122655

22656+
/**
22657+
* Signatures on the HTLC transactions
22658+
*
22659+
* Returns a copy of the field.
22660+
*/
22661+
struct LDKCVec_SignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
22662+
2264222663
/**
2264322664
* Signatures on the HTLC transactions
2264422665
*/
@@ -22970,6 +22991,13 @@ const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeA
2297022991
*/
2297122992
void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
2297222993

22994+
/**
22995+
* List of addresses on which this node is reachable
22996+
*
22997+
* Returns a copy of the field.
22998+
*/
22999+
struct LDKCVec_NetAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
23000+
2297323001
/**
2297423002
* List of addresses on which this node is reachable
2297523003
*/
@@ -23269,6 +23297,15 @@ uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKU
2326923297
*/
2327023298
void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
2327123299

23300+
/**
23301+
* Excess data which was signed as a part of the message which we do not (yet) understand how
23302+
* to decode. This is stored to ensure forward-compatibility as new fields are added to the
23303+
* lightning gossip
23304+
*
23305+
* Returns a copy of the field.
23306+
*/
23307+
struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23308+
2327223309
/**
2327323310
* Excess data which was signed as a part of the message which we do not (yet) understand how
2327423311
* to decode. This is stored to ensure forward-compatibility as new fields are added to the
@@ -23411,6 +23448,13 @@ bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONN
2341123448
*/
2341223449
void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
2341323450

23451+
/**
23452+
* The short_channel_ids in the channel range
23453+
*
23454+
* Returns a copy of the field.
23455+
*/
23456+
struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
23457+
2341423458
/**
2341523459
* The short_channel_ids in the channel range
2341623460
*/
@@ -23441,6 +23485,13 @@ const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortCh
2344123485
*/
2344223486
void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
2344323487

23488+
/**
23489+
* The short_channel_ids that are being queried
23490+
*
23491+
* Returns a copy of the field.
23492+
*/
23493+
struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
23494+
2344423495
/**
2344523496
* The short_channel_ids that are being queried
2344623497
*/
@@ -24981,6 +25032,13 @@ struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struc
2498125032
*/
2498225033
void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
2498325034

25035+
/**
25036+
* All non-dust counterparty HTLC signatures, in the order they appear in the transaction
25037+
*
25038+
* Returns a copy of the field.
25039+
*/
25040+
struct LDKCVec_SignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
25041+
2498425042
/**
2498525043
* All non-dust counterparty HTLC signatures, in the order they appear in the transaction
2498625044
*/
@@ -26736,6 +26794,13 @@ struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncem
2673626794
*/
2673726795
void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
2673826796

26797+
/**
26798+
* Internet-level addresses via which one can connect to the node
26799+
*
26800+
* Returns a copy of the field.
26801+
*/
26802+
struct LDKCVec_NetAddressZ NodeAnnouncementInfo_get_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26803+
2673926804
/**
2674026805
* Internet-level addresses via which one can connect to the node
2674126806
*/
@@ -26815,6 +26880,13 @@ struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
2681526880
*/
2681626881
void NodeInfo_free(struct LDKNodeInfo this_obj);
2681726882

26883+
/**
26884+
* All valid channels a node has announced
26885+
*
26886+
* Returns a copy of the field.
26887+
*/
26888+
struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26889+
2681826890
/**
2681926891
* All valid channels a node has announced
2682026892
*/
@@ -27415,6 +27487,15 @@ uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct
2741527487
*/
2741627488
void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
2741727489

27490+
/**
27491+
* A list of SCIDs which this payment was previously attempted over and which caused the
27492+
* payment to fail. Future attempts for the same payment shouldn't be relayed through any of
27493+
* these SCIDs.
27494+
*
27495+
* Returns a copy of the field.
27496+
*/
27497+
struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27498+
2741827499
/**
2741927500
* A list of SCIDs which this payment was previously attempted over and which caused the
2742027501
* payment to fail. Future attempts for the same payment shouldn't be relayed through any of

lightning-c-bindings/src/lightning/chain/keysinterface.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ pub extern "C" fn DelayedPaymentOutputDescriptor_set_to_self_delay(this_ptr: &mu
106106
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.to_self_delay = val;
107107
}
108108
/// The output which is referenced by the given outpoint
109+
///
110+
/// Returns a copy of the field.
111+
#[no_mangle]
112+
pub extern "C" fn DelayedPaymentOutputDescriptor_get_output(this_ptr: &DelayedPaymentOutputDescriptor) -> crate::c_types::TxOut {
113+
let mut inner_val = this_ptr.get_native_mut_ref().output.clone();
114+
crate::c_types::TxOut::from_rust(inner_val)
115+
}
116+
/// The output which is referenced by the given outpoint
109117
#[no_mangle]
110118
pub extern "C" fn DelayedPaymentOutputDescriptor_set_output(this_ptr: &mut DelayedPaymentOutputDescriptor, mut val: crate::c_types::TxOut) {
111119
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.output = val.into_rust();
@@ -262,6 +270,14 @@ pub extern "C" fn StaticPaymentOutputDescriptor_set_outpoint(this_ptr: &mut Stat
262270
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.outpoint = *unsafe { Box::from_raw(val.take_inner()) };
263271
}
264272
/// The output which is referenced by the given outpoint
273+
///
274+
/// Returns a copy of the field.
275+
#[no_mangle]
276+
pub extern "C" fn StaticPaymentOutputDescriptor_get_output(this_ptr: &StaticPaymentOutputDescriptor) -> crate::c_types::TxOut {
277+
let mut inner_val = this_ptr.get_native_mut_ref().output.clone();
278+
crate::c_types::TxOut::from_rust(inner_val)
279+
}
280+
/// The output which is referenced by the given outpoint
265281
#[no_mangle]
266282
pub extern "C" fn StaticPaymentOutputDescriptor_set_output(this_ptr: &mut StaticPaymentOutputDescriptor, mut val: crate::c_types::TxOut) {
267283
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.output = val.into_rust();

lightning-c-bindings/src/lightning/ln/chan_utils.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,15 @@ pub extern "C" fn HolderCommitmentTransaction_set_counterparty_sig(this_ptr: &mu
13221322
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.counterparty_sig = val.into_rust();
13231323
}
13241324
/// All non-dust counterparty HTLC signatures, in the order they appear in the transaction
1325+
///
1326+
/// Returns a copy of the field.
1327+
#[no_mangle]
1328+
pub extern "C" fn HolderCommitmentTransaction_get_counterparty_htlc_sigs(this_ptr: &HolderCommitmentTransaction) -> crate::c_types::derived::CVec_SignatureZ {
1329+
let mut inner_val = this_ptr.get_native_mut_ref().counterparty_htlc_sigs.clone();
1330+
let mut local_inner_val = Vec::new(); for mut item in inner_val.drain(..) { local_inner_val.push( { crate::c_types::Signature::from_rust(&item) }); };
1331+
local_inner_val.into()
1332+
}
1333+
/// All non-dust counterparty HTLC signatures, in the order they appear in the transaction
13251334
#[no_mangle]
13261335
pub extern "C" fn HolderCommitmentTransaction_set_counterparty_htlc_sigs(this_ptr: &mut HolderCommitmentTransaction, mut val: crate::c_types::derived::CVec_SignatureZ) {
13271336
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_rust() }); };

lightning-c-bindings/src/lightning/ln/msgs.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,6 +2362,15 @@ pub extern "C" fn CommitmentSigned_set_signature(this_ptr: &mut CommitmentSigned
23622362
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.signature = val.into_rust();
23632363
}
23642364
/// Signatures on the HTLC transactions
2365+
///
2366+
/// Returns a copy of the field.
2367+
#[no_mangle]
2368+
pub extern "C" fn CommitmentSigned_get_htlc_signatures(this_ptr: &CommitmentSigned) -> crate::c_types::derived::CVec_SignatureZ {
2369+
let mut inner_val = this_ptr.get_native_mut_ref().htlc_signatures.clone();
2370+
let mut local_inner_val = Vec::new(); for mut item in inner_val.drain(..) { local_inner_val.push( { crate::c_types::Signature::from_rust(&item) }); };
2371+
local_inner_val.into()
2372+
}
2373+
/// Signatures on the HTLC transactions
23652374
#[no_mangle]
23662375
pub extern "C" fn CommitmentSigned_set_htlc_signatures(this_ptr: &mut CommitmentSigned, mut val: crate::c_types::derived::CVec_SignatureZ) {
23672376
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_rust() }); };
@@ -3332,6 +3341,15 @@ pub extern "C" fn UnsignedNodeAnnouncement_set_alias(this_ptr: &mut UnsignedNode
33323341
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.alias = val.data;
33333342
}
33343343
/// List of addresses on which this node is reachable
3344+
///
3345+
/// Returns a copy of the field.
3346+
#[no_mangle]
3347+
pub extern "C" fn UnsignedNodeAnnouncement_get_addresses(this_ptr: &UnsignedNodeAnnouncement) -> crate::c_types::derived::CVec_NetAddressZ {
3348+
let mut inner_val = this_ptr.get_native_mut_ref().addresses.clone();
3349+
let mut local_inner_val = Vec::new(); for mut item in inner_val.drain(..) { local_inner_val.push( { crate::lightning::ln::msgs::NetAddress::native_into(item) }); };
3350+
local_inner_val.into()
3351+
}
3352+
/// List of addresses on which this node is reachable
33353353
#[no_mangle]
33363354
pub extern "C" fn UnsignedNodeAnnouncement_set_addresses(this_ptr: &mut UnsignedNodeAnnouncement, mut val: crate::c_types::derived::CVec_NetAddressZ) {
33373355
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_native() }); };
@@ -3908,6 +3926,17 @@ pub extern "C" fn UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr
39083926
/// Excess data which was signed as a part of the message which we do not (yet) understand how
39093927
/// to decode. This is stored to ensure forward-compatibility as new fields are added to the
39103928
/// lightning gossip
3929+
///
3930+
/// Returns a copy of the field.
3931+
#[no_mangle]
3932+
pub extern "C" fn UnsignedChannelUpdate_get_excess_data(this_ptr: &UnsignedChannelUpdate) -> crate::c_types::derived::CVec_u8Z {
3933+
let mut inner_val = this_ptr.get_native_mut_ref().excess_data.clone();
3934+
let mut local_inner_val = Vec::new(); for mut item in inner_val.drain(..) { local_inner_val.push( { item }); };
3935+
local_inner_val.into()
3936+
}
3937+
/// Excess data which was signed as a part of the message which we do not (yet) understand how
3938+
/// to decode. This is stored to ensure forward-compatibility as new fields are added to the
3939+
/// lightning gossip
39113940
#[no_mangle]
39123941
pub extern "C" fn UnsignedChannelUpdate_set_excess_data(this_ptr: &mut UnsignedChannelUpdate, mut val: crate::c_types::derived::CVec_u8Z) {
39133942
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); };
@@ -4269,6 +4298,15 @@ pub extern "C" fn ReplyChannelRange_set_sync_complete(this_ptr: &mut ReplyChanne
42694298
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.sync_complete = val;
42704299
}
42714300
/// The short_channel_ids in the channel range
4301+
///
4302+
/// Returns a copy of the field.
4303+
#[no_mangle]
4304+
pub extern "C" fn ReplyChannelRange_get_short_channel_ids(this_ptr: &ReplyChannelRange) -> crate::c_types::derived::CVec_u64Z {
4305+
let mut inner_val = this_ptr.get_native_mut_ref().short_channel_ids.clone();
4306+
let mut local_inner_val = Vec::new(); for mut item in inner_val.drain(..) { local_inner_val.push( { item }); };
4307+
local_inner_val.into()
4308+
}
4309+
/// The short_channel_ids in the channel range
42724310
#[no_mangle]
42734311
pub extern "C" fn ReplyChannelRange_set_short_channel_ids(this_ptr: &mut ReplyChannelRange, mut val: crate::c_types::derived::CVec_u64Z) {
42744312
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); };
@@ -4376,6 +4414,15 @@ pub extern "C" fn QueryShortChannelIds_set_chain_hash(this_ptr: &mut QueryShortC
43764414
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap();
43774415
}
43784416
/// The short_channel_ids that are being queried
4417+
///
4418+
/// Returns a copy of the field.
4419+
#[no_mangle]
4420+
pub extern "C" fn QueryShortChannelIds_get_short_channel_ids(this_ptr: &QueryShortChannelIds) -> crate::c_types::derived::CVec_u64Z {
4421+
let mut inner_val = this_ptr.get_native_mut_ref().short_channel_ids.clone();
4422+
let mut local_inner_val = Vec::new(); for mut item in inner_val.drain(..) { local_inner_val.push( { item }); };
4423+
local_inner_val.into()
4424+
}
4425+
/// The short_channel_ids that are being queried
43794426
#[no_mangle]
43804427
pub extern "C" fn QueryShortChannelIds_set_short_channel_ids(this_ptr: &mut QueryShortChannelIds, mut val: crate::c_types::derived::CVec_u64Z) {
43814428
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); };

lightning-c-bindings/src/lightning/routing/gossip.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,15 @@ pub extern "C" fn NodeAnnouncementInfo_set_alias(this_ptr: &mut NodeAnnouncement
15741574
unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.alias = *unsafe { Box::from_raw(val.take_inner()) };
15751575
}
15761576
/// Internet-level addresses via which one can connect to the node
1577+
///
1578+
/// Returns a copy of the field.
1579+
#[no_mangle]
1580+
pub extern "C" fn NodeAnnouncementInfo_get_addresses(this_ptr: &NodeAnnouncementInfo) -> crate::c_types::derived::CVec_NetAddressZ {
1581+
let mut inner_val = this_ptr.get_native_mut_ref().addresses.clone();
1582+
let mut local_inner_val = Vec::new(); for mut item in inner_val.drain(..) { local_inner_val.push( { crate::lightning::ln::msgs::NetAddress::native_into(item) }); };
1583+
local_inner_val.into()
1584+
}
1585+
/// Internet-level addresses via which one can connect to the node
15771586
#[no_mangle]
15781587
pub extern "C" fn NodeAnnouncementInfo_set_addresses(this_ptr: &mut NodeAnnouncementInfo, mut val: crate::c_types::derived::CVec_NetAddressZ) {
15791588
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_native() }); };
@@ -1810,6 +1819,15 @@ impl NodeInfo {
18101819
}
18111820
}
18121821
/// All valid channels a node has announced
1822+
///
1823+
/// Returns a copy of the field.
1824+
#[no_mangle]
1825+
pub extern "C" fn NodeInfo_get_channels(this_ptr: &NodeInfo) -> crate::c_types::derived::CVec_u64Z {
1826+
let mut inner_val = this_ptr.get_native_mut_ref().channels.clone();
1827+
let mut local_inner_val = Vec::new(); for mut item in inner_val.drain(..) { local_inner_val.push( { item }); };
1828+
local_inner_val.into()
1829+
}
1830+
/// All valid channels a node has announced
18131831
#[no_mangle]
18141832
pub extern "C" fn NodeInfo_set_channels(this_ptr: &mut NodeInfo, mut val: crate::c_types::derived::CVec_u64Z) {
18151833
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); };

lightning-c-bindings/src/lightning/routing/router.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,17 @@ pub extern "C" fn PaymentParameters_set_max_channel_saturation_power_of_half(thi
716716
/// A list of SCIDs which this payment was previously attempted over and which caused the
717717
/// payment to fail. Future attempts for the same payment shouldn't be relayed through any of
718718
/// these SCIDs.
719+
///
720+
/// Returns a copy of the field.
721+
#[no_mangle]
722+
pub extern "C" fn PaymentParameters_get_previously_failed_channels(this_ptr: &PaymentParameters) -> crate::c_types::derived::CVec_u64Z {
723+
let mut inner_val = this_ptr.get_native_mut_ref().previously_failed_channels.clone();
724+
let mut local_inner_val = Vec::new(); for mut item in inner_val.drain(..) { local_inner_val.push( { item }); };
725+
local_inner_val.into()
726+
}
727+
/// A list of SCIDs which this payment was previously attempted over and which caused the
728+
/// payment to fail. Future attempts for the same payment shouldn't be relayed through any of
729+
/// these SCIDs.
719730
#[no_mangle]
720731
pub extern "C" fn PaymentParameters_set_previously_failed_channels(this_ptr: &mut PaymentParameters, mut val: crate::c_types::derived::CVec_u64Z) {
721732
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); };

0 commit comments

Comments
 (0)