You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Gets the latest best block which was connected either via the [`chain::Listen`] or
1194
+
/// [`chain::Confirm`] interfaces.
1195
+
pubfncurrent_best_block(&self) -> BestBlock{
1196
+
self.inner.lock().unwrap().best_block.clone()
1197
+
}
1192
1198
}
1193
1199
1194
1200
impl<Signer:Sign>ChannelMonitorImpl<Signer>{
@@ -2827,11 +2833,11 @@ mod tests {
2827
2833
use bitcoin::hash_types::Txid;
2828
2834
use bitcoin::network::constants::Network;
2829
2835
use hex;
2836
+
use chain::BestBlock;
2830
2837
use chain::channelmonitor::ChannelMonitor;
2831
2838
use chain::package::{WEIGHT_OFFERED_HTLC,WEIGHT_RECEIVED_HTLC,WEIGHT_REVOKED_OFFERED_HTLC,WEIGHT_REVOKED_RECEIVED_HTLC,WEIGHT_REVOKED_OUTPUT};
2832
2839
use chain::transaction::OutPoint;
2833
2840
use ln::{PaymentPreimage,PaymentHash};
2834
-
use ln::channelmanager::BestBlock;
2835
2841
use ln::chan_utils;
2836
2842
use ln::chan_utils::{HTLCOutputInCommitment,ChannelPublicKeys,ChannelTransactionParameters,HolderCommitmentTransaction,CounterpartyChannelTransactionParameters};
2837
2843
use util::test_utils::{TestLogger,TestBroadcaster,TestFeeEstimator};
Copy file name to clipboardExpand all lines: lightning/src/ln/channel.rs
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,10 @@ use ln::{PaymentPreimage, PaymentHash};
26
26
use ln::features::{ChannelFeatures,InitFeatures};
27
27
use ln::msgs;
28
28
use ln::msgs::{DecodeError,OptionalField,DataLossProtect};
29
-
use ln::channelmanager::{BestBlock,PendingHTLCStatus,HTLCSource,HTLCFailReason,HTLCFailureMsg,PendingHTLCInfo,RAACommitmentOrder,BREAKDOWN_TIMEOUT,MIN_CLTV_EXPIRY_DELTA,MAX_LOCAL_BREAKDOWN_TIMEOUT};
29
+
use ln::channelmanager::{PendingHTLCStatus,HTLCSource,HTLCFailReason,HTLCFailureMsg,PendingHTLCInfo,RAACommitmentOrder,BREAKDOWN_TIMEOUT,MIN_CLTV_EXPIRY_DELTA,MAX_LOCAL_BREAKDOWN_TIMEOUT};
30
30
use ln::chan_utils::{CounterpartyCommitmentSecrets,TxCreationKeys,HTLCOutputInCommitment,HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT, make_funding_redeemscript,ChannelPublicKeys,CommitmentTransaction,HolderCommitmentTransaction,ChannelTransactionParameters,CounterpartyChannelTransactionParameters,MAX_HTLCS, get_commitment_transaction_number_obscure_factor};
31
31
use ln::chan_utils;
32
+
use chain::BestBlock;
32
33
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
33
34
use chain::channelmonitor::{ChannelMonitor,ChannelMonitorUpdate,ChannelMonitorUpdateStep,HTLC_FAIL_BACK_BUFFER};
34
35
use chain::transaction::{OutPoint,TransactionData};
@@ -4962,13 +4963,14 @@ mod tests {
4962
4963
use bitcoin::hashes::hex::FromHex;
4963
4964
use hex;
4964
4965
use ln::{PaymentPreimage,PaymentHash};
4965
-
use ln::channelmanager::{BestBlock,HTLCSource};
4966
+
use ln::channelmanager::HTLCSource;
4966
4967
use ln::channel::{Channel,InboundHTLCOutput,OutboundHTLCOutput,InboundHTLCState,OutboundHTLCState,HTLCOutputInCommitment,HTLCCandidate,HTLCInitiator,TxCreationKeys};
4967
4968
use ln::channel::MAX_FUNDING_SATOSHIS;
4968
4969
use ln::features::InitFeatures;
4969
4970
use ln::msgs::{ChannelUpdate,DataLossProtect,DecodeError,OptionalField,UnsignedChannelUpdate};
4970
4971
use ln::chan_utils;
4971
4972
use ln::chan_utils::{ChannelPublicKeys,HolderCommitmentTransaction,CounterpartyChannelTransactionParameters,HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT};
4973
+
use chain::BestBlock;
4972
4974
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
4973
4975
use chain::keysinterface::{InMemorySigner,KeysInterface,BaseSign};
Copy file name to clipboardExpand all lines: lightning/src/ln/channelmanager.rs
+7-30Lines changed: 7 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,7 @@ use bitcoin::secp256k1::ecdh::SharedSecret;
36
36
use bitcoin::secp256k1;
37
37
38
38
use chain;
39
-
use chain::Confirm;
40
-
use chain::Watch;
39
+
use chain::{Confirm,Watch,BestBlock};
41
40
use chain::chaininterface::{BroadcasterInterface,FeeEstimator};
42
41
use chain::channelmonitor::{ChannelMonitor,ChannelMonitorUpdate,ChannelMonitorUpdateStep,ChannelMonitorUpdateErr,HTLC_FAIL_BACK_BUFFER,CLTV_CLAIM_BUFFER,LATENCY_GRACE_PERIOD_BLOCKS,ANTI_REORG_DELAY,MonitorEvent,CLOSED_CHANNEL_UPDATE_ID};
43
42
use chain::transaction::{OutPoint,TransactionData};
@@ -508,34 +507,6 @@ pub struct ChainParameters {
508
507
pubbest_block:BestBlock,
509
508
}
510
509
511
-
/// The best known block as identified by its hash and height.
512
-
#[derive(Clone,Copy,PartialEq)]
513
-
pubstructBestBlock{
514
-
block_hash:BlockHash,
515
-
height:u32,
516
-
}
517
-
518
-
implBestBlock{
519
-
/// Returns the best block from the genesis of the given network.
0 commit comments