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
use bitcoin::blockdata::transaction::{Transaction,TxIn,TxOut,SigHashType};
@@ -2859,7 +2852,7 @@ mod tests {
2859
2852
use hex;
2860
2853
use chain::channelmonitor::ChannelMonitor;
2861
2854
use chain::transaction::OutPoint;
2862
-
use ln::channelmanager::{PaymentPreimage,PaymentHash};
2855
+
use ln::channelmanager::{BestBlock,PaymentPreimage,PaymentHash};
2863
2856
use ln::onchaintx::{OnchainTxHandler,InputDescriptors};
2864
2857
use ln::chan_utils;
2865
2858
use ln::chan_utils::{HTLCOutputInCommitment,ChannelPublicKeys,ChannelTransactionParameters,HolderCommitmentTransaction,CounterpartyChannelTransactionParameters};
@@ -2955,14 +2948,13 @@ mod tests {
2955
2948
};
2956
2949
// Prune with one old state and a holder commitment tx holding a few overlaps with the
2957
2950
// old state.
2958
-
let last_block_hash = genesis_block(Network::Testnet).block_hash();
2959
-
let last_block_height = 0;
2951
+
let best_block = BestBlock::from_genesis(Network::Testnet);
2960
2952
let monitor = ChannelMonitor::new(Secp256k1::new(), keys,
Copy file name to clipboardExpand all lines: lightning/src/ln/channel.rs
+10-11Lines changed: 10 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ use bitcoin::secp256k1;
24
24
use ln::features::{ChannelFeatures,InitFeatures};
25
25
use ln::msgs;
26
26
use ln::msgs::{DecodeError,OptionalField,DataLossProtect};
27
-
use ln::channelmanager::{PendingHTLCStatus,HTLCSource,HTLCFailReason,HTLCFailureMsg,PendingHTLCInfo,RAACommitmentOrder,PaymentPreimage,PaymentHash,BREAKDOWN_TIMEOUT,MIN_CLTV_EXPIRY_DELTA,MAX_LOCAL_BREAKDOWN_TIMEOUT};
27
+
use ln::channelmanager::{BestBlock,PendingHTLCStatus,HTLCSource,HTLCFailReason,HTLCFailureMsg,PendingHTLCInfo,RAACommitmentOrder,PaymentPreimage,PaymentHash,BREAKDOWN_TIMEOUT,MIN_CLTV_EXPIRY_DELTA,MAX_LOCAL_BREAKDOWN_TIMEOUT};
28
28
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};
29
29
use ln::chan_utils;
30
30
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
use ln::channelmanager::{HTLCSource,PaymentPreimage,PaymentHash};
4794
+
use ln::channelmanager::{BestBlock,HTLCSource,PaymentPreimage,PaymentHash};
4795
4795
use ln::channel::{Channel,Sign,InboundHTLCOutput,OutboundHTLCOutput,InboundHTLCState,OutboundHTLCState,HTLCOutputInCommitment,HTLCCandidate,HTLCInitiator,TxCreationKeys};
4796
4796
use ln::channel::MAX_FUNDING_SATOSHIS;
4797
4797
use ln::features::InitFeatures;
@@ -5004,9 +5004,8 @@ mod tests {
5004
5004
let secp_ctx = Secp256k1::new();
5005
5005
let seed = [42;32];
5006
5006
let network = Network::Testnet;
5007
-
let chain_hash = genesis_block(network).header.block_hash();
5008
-
let last_block_hash = chain_hash;
5009
-
let last_block_height = 0;
5007
+
let best_block = BestBlock::from_genesis(network);
5008
+
let chain_hash = best_block.block_hash();
5010
5009
let keys_provider = test_utils::TestKeysInterface::new(&seed, network);
5011
5010
5012
5011
// Go through the flow of opening a channel between two nodes.
@@ -5032,10 +5031,10 @@ mod tests {
5032
5031
}]};
5033
5032
let funding_outpoint = OutPoint{txid: tx.txid(),index:0};
5034
5033
let funding_created_msg = node_a_chan.get_outbound_funding_created(funding_outpoint,&&logger).unwrap();
0 commit comments