X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FScoreLookUp.cs;fp=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FScoreLookUp.cs;h=aefbc190b812a0726a2ad5cc895d849b4608968a;hb=3d1f246d05172683acd3b81836de4e4e9f0c1afd;hp=42310a5e8e02677b731d07af76f22d2575216f83;hpb=a32b8843c44637ebd82c83390d17db573b972153;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/ScoreLookUp.cs b/c_sharp/src/org/ldk/structs/ScoreLookUp.cs index 42310a5e..aefbc190 100644 --- a/c_sharp/src/org/ldk/structs/ScoreLookUp.cs +++ b/c_sharp/src/org/ldk/structs/ScoreLookUp.cs @@ -19,7 +19,7 @@ public interface ScoreLookUpInterface { * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount. * Thus, implementations should be overflow-safe. */ - long channel_penalty_msat(long short_channel_id, NodeId source, NodeId target, ChannelUsage usage, ProbabilisticScoringFeeParameters score_params); + long channel_penalty_msat(CandidateRouteHop candidate, ChannelUsage usage, ProbabilisticScoringFeeParameters score_params); } /** @@ -43,13 +43,12 @@ public class ScoreLookUp : CommonBase { internal LDKScoreLookUpImpl(ScoreLookUpInterface arg, LDKScoreLookUpHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private ScoreLookUpInterface arg; private LDKScoreLookUpHolder impl_holder; - public long channel_penalty_msat(long _short_channel_id, long _source, long _target, long _usage, long _score_params) { - org.ldk.structs.NodeId _source_hu_conv = null; if (_source < 0 || _source > 4096) { _source_hu_conv = new org.ldk.structs.NodeId(null, _source); } - org.ldk.structs.NodeId _target_hu_conv = null; if (_target < 0 || _target > 4096) { _target_hu_conv = new org.ldk.structs.NodeId(null, _target); } + public long channel_penalty_msat(long _candidate, long _usage, long _score_params) { + CandidateRouteHop _candidate_hu_conv = CandidateRouteHop.constr_from_ptr(_candidate); org.ldk.structs.ChannelUsage _usage_hu_conv = null; if (_usage < 0 || _usage > 4096) { _usage_hu_conv = new org.ldk.structs.ChannelUsage(null, _usage); } if (_usage_hu_conv != null) { _usage_hu_conv.ptrs_to.AddLast(this); }; org.ldk.structs.ProbabilisticScoringFeeParameters _score_params_hu_conv = null; if (_score_params < 0 || _score_params > 4096) { _score_params_hu_conv = new org.ldk.structs.ProbabilisticScoringFeeParameters(null, _score_params); } - long ret = arg.channel_penalty_msat(_short_channel_id, _source_hu_conv, _target_hu_conv, _usage_hu_conv, _score_params_hu_conv); + long ret = arg.channel_penalty_msat(_candidate_hu_conv, _usage_hu_conv, _score_params_hu_conv); GC.KeepAlive(arg); return ret; } @@ -77,16 +76,12 @@ public class ScoreLookUp : CommonBase { * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount. * Thus, implementations should be overflow-safe. */ - public long channel_penalty_msat(long short_channel_id, org.ldk.structs.NodeId source, org.ldk.structs.NodeId target, org.ldk.structs.ChannelUsage usage, org.ldk.structs.ProbabilisticScoringFeeParameters score_params) { - long ret = bindings.ScoreLookUp_channel_penalty_msat(this.ptr, short_channel_id, source == null ? 0 : source.ptr, target == null ? 0 : target.ptr, usage == null ? 0 : usage.ptr, score_params == null ? 0 : score_params.ptr); + public long channel_penalty_msat(org.ldk.structs.CandidateRouteHop candidate, org.ldk.structs.ChannelUsage usage, org.ldk.structs.ProbabilisticScoringFeeParameters score_params) { + long ret = bindings.ScoreLookUp_channel_penalty_msat(this.ptr, candidate == null ? 0 : candidate.ptr, usage == null ? 0 : usage.ptr, score_params == null ? 0 : score_params.ptr); GC.KeepAlive(this); - GC.KeepAlive(short_channel_id); - GC.KeepAlive(source); - GC.KeepAlive(target); + GC.KeepAlive(candidate); GC.KeepAlive(usage); GC.KeepAlive(score_params); - if (this != null) { this.ptrs_to.AddLast(source); }; - if (this != null) { this.ptrs_to.AddLast(target); }; if (this != null) { this.ptrs_to.AddLast(usage); }; if (this != null) { this.ptrs_to.AddLast(score_params); }; return ret;