@@ -576,14 +576,14 @@ pub enum Balance {
576
576
ClaimableOnChannelClose {
577
577
/// The amount available to claim, in satoshis, excluding the on-chain fees which will be
578
578
/// required to do so.
579
- claimable_amount_satoshis : u64 ,
579
+ amount_satoshis : u64 ,
580
580
} ,
581
581
/// The channel has been closed, and the given balance is ours but awaiting confirmations until
582
582
/// we consider it spendable.
583
583
ClaimableAwaitingConfirmations {
584
584
/// The amount available to claim, in satoshis, possibly excluding the on-chain fees which
585
585
/// were spent in broadcasting the transaction.
586
- claimable_amount_satoshis : u64 ,
586
+ amount_satoshis : u64 ,
587
587
/// The height at which an [`Event::SpendableOutputs`] event will be generated for this
588
588
/// amount.
589
589
confirmation_height : u32 ,
@@ -598,7 +598,7 @@ pub enum Balance {
598
598
ContentiousClaimable {
599
599
/// The amount available to claim, in satoshis, excluding the on-chain fees which will be
600
600
/// required to do so.
601
- claimable_amount_satoshis : u64 ,
601
+ amount_satoshis : u64 ,
602
602
/// The height at which the counterparty may be able to claim the balance if we have not
603
603
/// done so.
604
604
timeout_height : u32 ,
@@ -613,7 +613,7 @@ pub enum Balance {
613
613
MaybeTimeoutClaimableHTLC {
614
614
/// The amount potentially available to claim, in satoshis, excluding the on-chain fees
615
615
/// which will be required to do so.
616
- claimable_amount_satoshis : u64 ,
616
+ amount_satoshis : u64 ,
617
617
/// The height at which we will be able to claim the balance if our counterparty has not
618
618
/// done so.
619
619
claimable_height : u32 ,
@@ -626,7 +626,7 @@ pub enum Balance {
626
626
MaybePreimageClaimableHTLC {
627
627
/// The amount potentially available to claim, in satoshis, excluding the on-chain fees
628
628
/// which will be required to do so.
629
- claimable_amount_satoshis : u64 ,
629
+ amount_satoshis : u64 ,
630
630
/// The height at which our counterparty will be able to claim the balance if we have not
631
631
/// yet received the preimage and claimed it ourselves.
632
632
expiry_height : u32 ,
@@ -643,7 +643,7 @@ pub enum Balance {
643
643
///
644
644
/// Note that for outputs from HTLC balances this may be excluding some on-chain fees that
645
645
/// were already spent.
646
- claimable_amount_satoshis : u64 ,
646
+ amount_satoshis : u64 ,
647
647
} ,
648
648
}
649
649
@@ -656,27 +656,14 @@ impl Balance {
656
656
/// On-chain fees required to claim the balance are not included in this amount.
657
657
pub fn claimable_amount_satoshis ( & self ) -> u64 {
658
658
match self {
659
- Balance :: ClaimableOnChannelClose {
660
- claimable_amount_satoshis,
661
- } => * claimable_amount_satoshis,
662
- Balance :: ClaimableAwaitingConfirmations {
663
- claimable_amount_satoshis,
664
- ..
665
- } => * claimable_amount_satoshis,
666
- Balance :: ContentiousClaimable {
667
- claimable_amount_satoshis,
668
- ..
669
- } => * claimable_amount_satoshis,
670
- Balance :: MaybeTimeoutClaimableHTLC {
671
- ..
672
- } => 0 ,
673
- Balance :: MaybePreimageClaimableHTLC {
674
- ..
675
- } => 0 ,
676
- Balance :: CounterpartyRevokedOutputClaimable {
677
- claimable_amount_satoshis,
678
- ..
679
- } => * claimable_amount_satoshis,
659
+ Balance :: ClaimableOnChannelClose { amount_satoshis, .. } |
660
+ Balance :: ClaimableAwaitingConfirmations { amount_satoshis, .. } |
661
+ Balance :: ContentiousClaimable { amount_satoshis, .. } |
662
+ Balance :: CounterpartyRevokedOutputClaimable { amount_satoshis, .. }
663
+ => * amount_satoshis,
664
+ Balance :: MaybeTimeoutClaimableHTLC { .. } |
665
+ Balance :: MaybePreimageClaimableHTLC { .. }
666
+ => 0 ,
680
667
}
681
668
}
682
669
}
@@ -1672,7 +1659,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
1672
1659
if let Some ( conf_thresh) = holder_delayed_output_pending {
1673
1660
debug_assert ! ( holder_commitment) ;
1674
1661
return Some ( Balance :: ClaimableAwaitingConfirmations {
1675
- claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1662
+ amount_satoshis : htlc. amount_msat / 1000 ,
1676
1663
confirmation_height : conf_thresh,
1677
1664
} ) ;
1678
1665
} else if htlc_resolved. is_some ( ) && !htlc_output_spend_pending {
@@ -1710,7 +1697,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
1710
1697
debug_assert ! ( !htlc. offered || htlc_spend_pending. is_none( ) || !htlc_spend_pending. unwrap( ) . 1 ,
1711
1698
"We don't (currently) generate preimage claims against revoked outputs, where did you get one?!" ) ;
1712
1699
return Some ( Balance :: CounterpartyRevokedOutputClaimable {
1713
- claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1700
+ amount_satoshis : htlc. amount_msat / 1000 ,
1714
1701
} ) ;
1715
1702
}
1716
1703
} else if htlc. offered == holder_commitment {
@@ -1719,12 +1706,12 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
1719
1706
// and awaiting confirmations on it.
1720
1707
if let Some ( conf_thresh) = holder_timeout_spend_pending {
1721
1708
return Some ( Balance :: ClaimableAwaitingConfirmations {
1722
- claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1709
+ amount_satoshis : htlc. amount_msat / 1000 ,
1723
1710
confirmation_height : conf_thresh,
1724
1711
} ) ;
1725
1712
} else {
1726
1713
return Some ( Balance :: MaybeTimeoutClaimableHTLC {
1727
- claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1714
+ amount_satoshis : htlc. amount_msat / 1000 ,
1728
1715
claimable_height : htlc. cltv_expiry ,
1729
1716
payment_hash : htlc. payment_hash ,
1730
1717
} ) ;
@@ -1738,20 +1725,20 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
1738
1725
debug_assert ! ( holder_timeout_spend_pending. is_none( ) ) ;
1739
1726
if let Some ( ( conf_thresh, true ) ) = htlc_spend_pending {
1740
1727
return Some ( Balance :: ClaimableAwaitingConfirmations {
1741
- claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1728
+ amount_satoshis : htlc. amount_msat / 1000 ,
1742
1729
confirmation_height : conf_thresh,
1743
1730
} ) ;
1744
1731
} else {
1745
1732
return Some ( Balance :: ContentiousClaimable {
1746
- claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1733
+ amount_satoshis : htlc. amount_msat / 1000 ,
1747
1734
timeout_height : htlc. cltv_expiry ,
1748
1735
payment_hash : htlc. payment_hash ,
1749
1736
payment_preimage : * payment_preimage,
1750
1737
} ) ;
1751
1738
}
1752
1739
} else if htlc_resolved. is_none ( ) {
1753
1740
return Some ( Balance :: MaybePreimageClaimableHTLC {
1754
- claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1741
+ amount_satoshis : htlc. amount_msat / 1000 ,
1755
1742
expiry_height : htlc. cltv_expiry ,
1756
1743
payment_hash : htlc. payment_hash ,
1757
1744
} ) ;
@@ -1824,7 +1811,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1824
1811
} else { None }
1825
1812
} ) {
1826
1813
res. push ( Balance :: ClaimableAwaitingConfirmations {
1827
- claimable_amount_satoshis : value,
1814
+ amount_satoshis : value,
1828
1815
confirmation_height : conf_thresh,
1829
1816
} ) ;
1830
1817
} else {
@@ -1847,7 +1834,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1847
1834
descriptor : SpendableOutputDescriptor :: StaticOutput { output, .. }
1848
1835
} = & event. event {
1849
1836
res. push ( Balance :: ClaimableAwaitingConfirmations {
1850
- claimable_amount_satoshis : output. value ,
1837
+ amount_satoshis : output. value ,
1851
1838
confirmation_height : event. confirmation_threshold ( ) ,
1852
1839
} ) ;
1853
1840
if let Some ( confirmed_to_self_idx) = confirmed_counterparty_output. map ( |( idx, _) | idx) {
@@ -1866,7 +1853,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1866
1853
. is_output_spend_pending ( & BitcoinOutPoint :: new ( txid, confirmed_to_self_idx) ) ;
1867
1854
if output_spendable {
1868
1855
res. push ( Balance :: CounterpartyRevokedOutputClaimable {
1869
- claimable_amount_satoshis : amt,
1856
+ amount_satoshis : amt,
1870
1857
} ) ;
1871
1858
}
1872
1859
} else {
@@ -1879,7 +1866,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1879
1866
walk_htlcs ! ( true , false , us. current_holder_commitment_tx. htlc_outputs. iter( ) . map( |( a, _, _) | a) ) ;
1880
1867
if let Some ( conf_thresh) = pending_commitment_tx_conf_thresh {
1881
1868
res. push ( Balance :: ClaimableAwaitingConfirmations {
1882
- claimable_amount_satoshis : us. current_holder_commitment_tx . to_self_value_sat ,
1869
+ amount_satoshis : us. current_holder_commitment_tx . to_self_value_sat ,
1883
1870
confirmation_height : conf_thresh,
1884
1871
} ) ;
1885
1872
}
@@ -1889,7 +1876,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1889
1876
walk_htlcs ! ( true , false , prev_commitment. htlc_outputs. iter( ) . map( |( a, _, _) | a) ) ;
1890
1877
if let Some ( conf_thresh) = pending_commitment_tx_conf_thresh {
1891
1878
res. push ( Balance :: ClaimableAwaitingConfirmations {
1892
- claimable_amount_satoshis : prev_commitment. to_self_value_sat ,
1879
+ amount_satoshis : prev_commitment. to_self_value_sat ,
1893
1880
confirmation_height : conf_thresh,
1894
1881
} ) ;
1895
1882
}
@@ -1902,7 +1889,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1902
1889
// neither us nor our counterparty misbehaved. At worst we've under-estimated
1903
1890
// the amount we can claim as we'll punish a misbehaving counterparty.
1904
1891
res. push ( Balance :: ClaimableAwaitingConfirmations {
1905
- claimable_amount_satoshis : us. current_holder_commitment_tx . to_self_value_sat ,
1892
+ amount_satoshis : us. current_holder_commitment_tx . to_self_value_sat ,
1906
1893
confirmation_height : conf_thresh,
1907
1894
} ) ;
1908
1895
}
@@ -1913,7 +1900,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1913
1900
if htlc. transaction_output_index . is_none ( ) { continue ; }
1914
1901
if htlc. offered {
1915
1902
res. push ( Balance :: MaybeTimeoutClaimableHTLC {
1916
- claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1903
+ amount_satoshis : htlc. amount_msat / 1000 ,
1917
1904
claimable_height : htlc. cltv_expiry ,
1918
1905
payment_hash : htlc. payment_hash ,
1919
1906
} ) ;
@@ -1923,14 +1910,14 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
1923
1910
// As long as the HTLC is still in our latest commitment state, treat
1924
1911
// it as potentially claimable, even if it has long-since expired.
1925
1912
res. push ( Balance :: MaybePreimageClaimableHTLC {
1926
- claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1913
+ amount_satoshis : htlc. amount_msat / 1000 ,
1927
1914
expiry_height : htlc. cltv_expiry ,
1928
1915
payment_hash : htlc. payment_hash ,
1929
1916
} ) ;
1930
1917
}
1931
1918
}
1932
1919
res. push ( Balance :: ClaimableOnChannelClose {
1933
- claimable_amount_satoshis : us. current_holder_commitment_tx . to_self_value_sat + claimable_inbound_htlc_value_sat,
1920
+ amount_satoshis : us. current_holder_commitment_tx . to_self_value_sat + claimable_inbound_htlc_value_sat,
1934
1921
} ) ;
1935
1922
}
1936
1923
0 commit comments