File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1264,7 +1264,10 @@ impl Channel {
1264
1264
if msg. max_accepted_htlcs > 483 {
1265
1265
return_error_message ! ( "max_accpted_htlcs > 483" ) ;
1266
1266
}
1267
-
1267
+ //Optional user definined limits
1268
+ if msg. minimum_depth > self . config . channel_limits . minimum_depth {
1269
+ return_error_message ! ( "We consider the minimum depth to be unreasonably large" ) ;
1270
+ }
1268
1271
self . channel_monitor . set_their_base_keys ( & msg. htlc_basepoint , & msg. delayed_payment_basepoint ) ;
1269
1272
1270
1273
self . their_dust_limit_satoshis = msg. dust_limit_satoshis ;
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ pub struct ChannelLimits{
34
34
pub max_accepted_htlcs : u16 ,
35
35
/// min allowed dust_limit_satashis
36
36
pub dust_limit_satoshis : u64 ,
37
+ ///minimum depth to a number of blocks that is considered reasonable to avoid double-spending of the funding transaction
38
+ pub minimum_depth : u32 ,
37
39
}
38
40
39
41
impl ChannelLimits {
@@ -46,6 +48,7 @@ impl ChannelLimits {
46
48
channel_reserve_satoshis : <u64 >:: max_value ( ) ,
47
49
max_accepted_htlcs : 0 ,
48
50
dust_limit_satoshis : 0 ,
51
+ minimum_depth : <u32 >:: max_value ( ) ,
49
52
}
50
53
}
51
54
}
You can’t perform that action at this time.
0 commit comments