@@ -1462,8 +1462,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1462
1462
for ( idx, outp) in tx. output . iter ( ) . enumerate ( ) {
1463
1463
if outp. script_pubkey == revokeable_p2wsh {
1464
1464
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 ) ;
1465
- 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 ) ;
1466
- claimable_outpoints. push ( OnchainRequest { height_timer : None , height_original : height, content : justice_package} ) ;
1465
+ 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 ) ;
1466
+ claimable_outpoints. push ( OnchainRequest { height_original : height, content : justice_package} ) ;
1467
1467
}
1468
1468
}
1469
1469
@@ -1476,8 +1476,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1476
1476
return ( claimable_outpoints, ( commitment_txid, watch_outputs) ) ; // Corrupted per_commitment_data, fuck this user
1477
1477
}
1478
1478
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 ) ;
1479
- let justice_package = PackageTemplate :: build_package ( commitment_txid, transaction_output_index, PackageSolvingData :: RevokedOutput ( revk_outp) , PackageMalleability :: Malleable , htlc. cltv_expiry , true , 0 ) ;
1480
- claimable_outpoints. push ( OnchainRequest { height_timer : None , height_original : height, content : justice_package} ) ;
1479
+ let justice_package = PackageTemplate :: build_package ( commitment_txid, transaction_output_index, PackageSolvingData :: RevokedOutput ( revk_outp) , PackageMalleability :: Malleable , htlc. cltv_expiry , true , 0 , None ) ;
1480
+ claimable_outpoints. push ( OnchainRequest { height_original : height, content : justice_package} ) ;
1481
1481
}
1482
1482
}
1483
1483
}
@@ -1626,8 +1626,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1626
1626
let preimage = if htlc. offered { if let Some ( p) = self . payment_preimages . get ( & htlc. payment_hash ) { Some ( * p) } else { None } } else { None } ;
1627
1627
if preimage. is_some ( ) || !htlc. offered {
1628
1628
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 ( ) ) ;
1629
- 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 ) ;
1630
- claimable_outpoints. push ( OnchainRequest { height_timer : None , height_original : /*XXX(ariard) Option<height> */ 0 , content : counterparty_package } ) ;
1629
+ 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 ) ;
1630
+ claimable_outpoints. push ( OnchainRequest { height_original : /*XXX(ariard) Option<height> */ 0 , content : counterparty_package } ) ;
1631
1631
}
1632
1632
}
1633
1633
}
@@ -1659,8 +1659,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1659
1659
1660
1660
log_trace ! ( logger, "Counterparty HTLC broadcast {}:{}" , htlc_txid, 0 ) ;
1661
1661
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 ) ;
1662
- 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 ) ;
1663
- let claimable_outpoints = vec ! ( OnchainRequest { height_timer : None , height_original: height, content: justice_package } ) ;
1662
+ 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 ) ;
1663
+ let claimable_outpoints = vec ! ( OnchainRequest { height_original: height, content: justice_package } ) ;
1664
1664
let outputs = vec ! [ ( 0 , tx. output[ 0 ] . clone( ) ) ] ;
1665
1665
( claimable_outpoints, Some ( ( htlc_txid, outputs) ) )
1666
1666
}
@@ -1684,8 +1684,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1684
1684
continue ;
1685
1685
}
1686
1686
} else { None } , htlc. amount_msat ) ;
1687
- let htlc_package = PackageTemplate :: build_package ( holder_tx. txid , transaction_output_index, PackageSolvingData :: HolderHTLCOutput ( htlc_output) , PackageMalleability :: Untractable , height, false , 0 ) ;
1688
- claim_requests. push ( OnchainRequest { height_timer : None , height_original : height, content : htlc_package } ) ;
1687
+ let htlc_package = PackageTemplate :: build_package ( holder_tx. txid , transaction_output_index, PackageSolvingData :: HolderHTLCOutput ( htlc_output) , PackageMalleability :: Untractable , height, false , 0 , None ) ;
1688
+ claim_requests. push ( OnchainRequest { height_original : height, content : htlc_package } ) ;
1689
1689
}
1690
1690
}
1691
1691
@@ -1893,8 +1893,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1893
1893
let should_broadcast = self . would_broadcast_at_height ( height, & logger) ;
1894
1894
if should_broadcast {
1895
1895
let funding_outp = HolderFundingOutput :: build ( self . funding_redeemscript . clone ( ) ) ;
1896
- 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 ) ;
1897
- claimable_outpoints. push ( OnchainRequest { height_timer : None , height_original : height, content : commitment_package } ) ;
1896
+ 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 ) ;
1897
+ claimable_outpoints. push ( OnchainRequest { height_original : height, content : commitment_package } ) ;
1898
1898
}
1899
1899
if should_broadcast {
1900
1900
self . pending_monitor_events . push ( MonitorEvent :: CommitmentTxBroadcasted ( self . funding_info . 0 ) ) ;
0 commit comments