File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1621,6 +1621,19 @@ impl Channel {
1621
1621
if ( self . channel_state & ( ChannelState :: ChannelFunded as u32 ) ) != ( ChannelState :: ChannelFunded as u32 ) {
1622
1622
return Err ( HandleError { err : "Cannot create commitment tx until channel is fully established" , msg : None } ) ;
1623
1623
}
1624
+ if ( self . channel_state & ( ChannelState :: AwaitingRemoteRevoke as u32 ) ) == ( ChannelState :: AwaitingRemoteRevoke as u32 ) {
1625
+ return Err ( HandleError { err : "Cannot create commitment tx until remote revokes their previous commitment" , msg : None } ) ;
1626
+ }
1627
+ let mut have_updates = false ; // TODO initialize with "have we sent a fee update?"
1628
+ for htlc in self . pending_htlcs . iter ( ) {
1629
+ if htlc. state == HTLCState :: LocalAnnounced {
1630
+ have_updates = true ;
1631
+ }
1632
+ if have_updates { break ; }
1633
+ }
1634
+ if !have_updates {
1635
+ return Err ( HandleError { err : "Cannot create commitment tx until we have some updates to send" , msg : None } ) ;
1636
+ }
1624
1637
1625
1638
let funding_script = self . get_funding_redeemscript ( ) ;
1626
1639
You can’t perform that action at this time.
0 commit comments