@@ -1582,8 +1582,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1582
1582
for ( idx, outp) in tx. output . iter ( ) . enumerate ( ) {
1583
1583
if outp. script_pubkey == revokeable_p2wsh {
1584
1584
let revk_outp = RevokedOutput :: build ( per_commitment_point, per_commitment_key, self . counterparty_tx_cache . counterparty_delayed_payment_base_key , self . counterparty_tx_cache . counterparty_htlc_base_key , InputDescriptors :: RevokedOutput , outp. value , None , self . counterparty_tx_cache . on_counterparty_tx_csv ) ;
1585
- let justice_package = PackageTemplate :: build_package ( commitment_txid, idx as u32 , PackageSolvingData :: RevokedOutput ( revk_outp) , PackageMalleability :: Malleable , height + self . counterparty_tx_cache . on_counterparty_tx_csv as u32 , true , 0 , None ) ;
1586
- claimable_outpoints. push ( OnchainRequest { height_original : height , content : justice_package} ) ;
1585
+ let justice_package = PackageTemplate :: build_package ( commitment_txid, idx as u32 , PackageSolvingData :: RevokedOutput ( revk_outp) , PackageMalleability :: Malleable , height + self . counterparty_tx_cache . on_counterparty_tx_csv as u32 , true , 0 , None , height ) ;
1586
+ claimable_outpoints. push ( OnchainRequest { content : justice_package} ) ;
1587
1587
}
1588
1588
}
1589
1589
@@ -1596,8 +1596,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1596
1596
return ( claimable_outpoints, ( commitment_txid, watch_outputs) ) ; // Corrupted per_commitment_data, fuck this user
1597
1597
}
1598
1598
let revk_outp = RevokedOutput :: build ( per_commitment_point, per_commitment_key, self . counterparty_tx_cache . counterparty_delayed_payment_base_key , self . counterparty_tx_cache . counterparty_htlc_base_key , if htlc. offered { InputDescriptors :: RevokedOfferedHTLC } else { InputDescriptors :: RevokedReceivedHTLC } , htlc. amount_msat / 1000 , Some ( htlc. clone ( ) ) , self . counterparty_tx_cache . on_counterparty_tx_csv ) ;
1599
- let justice_package = PackageTemplate :: build_package ( commitment_txid, transaction_output_index, PackageSolvingData :: RevokedOutput ( revk_outp) , PackageMalleability :: Malleable , htlc. cltv_expiry , true , 0 , None ) ;
1600
- claimable_outpoints. push ( OnchainRequest { height_original : height , content : justice_package} ) ;
1599
+ let justice_package = PackageTemplate :: build_package ( commitment_txid, transaction_output_index, PackageSolvingData :: RevokedOutput ( revk_outp) , PackageMalleability :: Malleable , htlc. cltv_expiry , true , 0 , None , height ) ;
1600
+ claimable_outpoints. push ( OnchainRequest { content : justice_package} ) ;
1601
1601
}
1602
1602
}
1603
1603
}
@@ -1745,8 +1745,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1745
1745
let preimage = if htlc. offered { if let Some ( p) = self . payment_preimages . get ( & htlc. payment_hash ) { Some ( * p) } else { None } } else { None } ;
1746
1746
if preimage. is_some ( ) || !htlc. offered {
1747
1747
let counterparty_htlc_outp = CounterpartyHTLCOutput :: build ( * revocation_point, self . counterparty_tx_cache . counterparty_delayed_payment_base_key , self . counterparty_tx_cache . counterparty_htlc_base_key , preimage, htlc. clone ( ) ) ;
1748
- let counterparty_package = PackageTemplate :: build_package ( commitment_txid, transaction_output_index, PackageSolvingData :: CounterpartyHTLCOutput ( counterparty_htlc_outp) , PackageMalleability :: Malleable , htlc. cltv_expiry , if !htlc. offered { false } else { true } , 0 , None ) ;
1749
- claimable_outpoints. push ( OnchainRequest { height_original : /*XXX(ariard) Option<height> */ 0 , content : counterparty_package } ) ;
1748
+ let counterparty_package = PackageTemplate :: build_package ( commitment_txid, transaction_output_index, PackageSolvingData :: CounterpartyHTLCOutput ( counterparty_htlc_outp) , PackageMalleability :: Malleable , htlc. cltv_expiry , if !htlc. offered { false } else { true } , 0 , None , 0 ) ;
1749
+ claimable_outpoints. push ( OnchainRequest { content : counterparty_package } ) ;
1750
1750
}
1751
1751
}
1752
1752
}
@@ -1778,8 +1778,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1778
1778
1779
1779
log_trace ! ( logger, "Counterparty HTLC broadcast {}:{}" , htlc_txid, 0 ) ;
1780
1780
let revk_outp = RevokedOutput :: build ( per_commitment_point, per_commitment_key, self . counterparty_tx_cache . counterparty_delayed_payment_base_key , self . counterparty_tx_cache . counterparty_htlc_base_key , InputDescriptors :: RevokedOutput , tx. output [ 0 ] . value , None , self . counterparty_tx_cache . on_counterparty_tx_csv ) ;
1781
- let justice_package = PackageTemplate :: build_package ( htlc_txid, 0 , PackageSolvingData :: RevokedOutput ( revk_outp) , PackageMalleability :: Malleable , height + self . counterparty_tx_cache . on_counterparty_tx_csv as u32 , true , 0 , None ) ;
1782
- let claimable_outpoints = vec ! ( OnchainRequest { height_original : height , content: justice_package } ) ;
1781
+ let justice_package = PackageTemplate :: build_package ( htlc_txid, 0 , PackageSolvingData :: RevokedOutput ( revk_outp) , PackageMalleability :: Malleable , height + self . counterparty_tx_cache . on_counterparty_tx_csv as u32 , true , 0 , None , height ) ;
1782
+ let claimable_outpoints = vec ! ( OnchainRequest { content: justice_package } ) ;
1783
1783
let outputs = vec ! [ ( 0 , tx. output[ 0 ] . clone( ) ) ] ;
1784
1784
( claimable_outpoints, Some ( ( htlc_txid, outputs) ) )
1785
1785
}
@@ -1803,8 +1803,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1803
1803
continue ;
1804
1804
}
1805
1805
} else { None } , htlc. amount_msat ) ;
1806
- let htlc_package = PackageTemplate :: build_package ( holder_tx. txid , transaction_output_index, PackageSolvingData :: HolderHTLCOutput ( htlc_output) , PackageMalleability :: Untractable , height, false , 0 , None ) ;
1807
- claim_requests. push ( OnchainRequest { height_original : height , content : htlc_package } ) ;
1806
+ let htlc_package = PackageTemplate :: build_package ( holder_tx. txid , transaction_output_index, PackageSolvingData :: HolderHTLCOutput ( htlc_output) , PackageMalleability :: Untractable , height, false , 0 , None , height ) ;
1807
+ claim_requests. push ( OnchainRequest { content : htlc_package } ) ;
1808
1808
}
1809
1809
}
1810
1810
@@ -2077,8 +2077,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2077
2077
let should_broadcast = self . would_broadcast_at_height ( height, & logger) ;
2078
2078
if should_broadcast {
2079
2079
let funding_outp = HolderFundingOutput :: build ( self . funding_redeemscript . clone ( ) ) ;
2080
- let commitment_package = PackageTemplate :: build_package ( self . funding_info . 0 . txid . clone ( ) , self . funding_info . 0 . index as u32 , PackageSolvingData :: HolderFundingOutput ( funding_outp) , PackageMalleability :: Untractable , height, false , 0 , None ) ;
2081
- claimable_outpoints. push ( OnchainRequest { height_original : height , content : commitment_package } ) ;
2080
+ let commitment_package = PackageTemplate :: build_package ( self . funding_info . 0 . txid . clone ( ) , self . funding_info . 0 . index as u32 , PackageSolvingData :: HolderFundingOutput ( funding_outp) , PackageMalleability :: Untractable , height, false , 0 , None , height ) ;
2081
+ claimable_outpoints. push ( OnchainRequest { content : commitment_package } ) ;
2082
2082
self . pending_monitor_events . push ( MonitorEvent :: CommitmentTxBroadcasted ( self . funding_info . 0 ) ) ;
2083
2083
let commitment_tx = self . onchain_tx_handler . get_fully_signed_holder_tx ( & self . funding_redeemscript ) ;
2084
2084
self . holder_tx_signed = true ;
0 commit comments