File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -1946,6 +1946,10 @@ impl<Signer: Sign> Channel<Signer> {
1946
1946
if msg. dust_limit_satoshis > self . holder_selected_channel_reserve_satoshis {
1947
1947
return Err ( ChannelError :: Close ( format ! ( "Dust limit ({}) is bigger than our channel reserve ({})" , msg. dust_limit_satoshis, self . holder_selected_channel_reserve_satoshis) ) ) ;
1948
1948
}
1949
+ if msg. channel_reserve_satoshis > self . channel_value_satoshis - self . holder_selected_channel_reserve_satoshis {
1950
+ return Err ( ChannelError :: Close ( format ! ( "Bogus channel_reserve_satoshis ({}). Must not be greater than channel value minus our reserve ({})" ,
1951
+ msg. channel_reserve_satoshis, self . channel_value_satoshis - self . holder_selected_channel_reserve_satoshis) ) ) ;
1952
+ }
1949
1953
let full_channel_value_msat = ( self . channel_value_satoshis - msg. channel_reserve_satoshis ) * 1000 ;
1950
1954
if msg. htlc_minimum_msat >= full_channel_value_msat {
1951
1955
return Err ( ChannelError :: Close ( format ! ( "Minimum htlc value ({}) is full channel value ({})" , msg. htlc_minimum_msat, full_channel_value_msat) ) ) ;
You can’t perform that action at this time.
0 commit comments