Skip to content

Commit e368cb0

Browse files
author
Yuko Roodt
committed
Merge branches '204-audit-bolt2-closing-negotiation' and '204-audit-bolt2-closing-negotiation' of github.com:neonknight64/rust-lightning into 204-audit-bolt2-closing-negotiation
# Conflicts: # src/ln/channelmanager.rs
2 parents 4489f2b + 924d90c commit e368cb0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/ln/channel.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use ln::chan_utils;
2323
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
2424
use chain::transaction::OutPoint;
2525
use chain::keysinterface::{ChannelKeys, KeysInterface};
26-
use util::{transaction_utils,rng};
26+
use util::transaction_utils;
2727
use util::ser::{Readable, ReadableArgs, Writeable, Writer, WriterWriteAdaptor};
2828
use util::logger::Logger;
2929
use util::errors::APIError;
@@ -410,7 +410,7 @@ impl Channel {
410410
}
411411

412412
// Constructors:
413-
pub fn new_outbound(fee_estimator: &FeeEstimator, keys_provider: &Arc<KeysInterface>, their_node_id: PublicKey, channel_value_satoshis: u64, push_msat: u64, user_id: u64, logger: Arc<Logger>, config: &UserConfig) -> Result<Channel, APIError> {
413+
pub fn new_outbound(fee_estimator: &FeeEstimator, keys_provider: &Arc<KeysInterface>, their_node_id: PublicKey,channel_id: [u8; 32], channel_value_satoshis: u64, push_msat: u64, user_id: u64, logger: Arc<Logger>, config: &UserConfig) -> Result<Channel, APIError> {
414414
let chan_keys = keys_provider.get_channel_keys(false);
415415

416416
if channel_value_satoshis >= MAX_FUNDING_SATOSHIS {
@@ -438,11 +438,11 @@ impl Channel {
438438
user_id: user_id,
439439
config: config.channel_options.clone(),
440440

441-
channel_id: rng::rand_u832(),
441+
channel_id,
442442
channel_state: ChannelState::OurInitSent as u32,
443443
channel_outbound: true,
444444
secp_ctx: secp_ctx,
445-
channel_value_satoshis: channel_value_satoshis,
445+
channel_value_satoshis,
446446

447447
local_keys: chan_keys,
448448
shutdown_pubkey: keys_provider.get_shutdown_pubkey(),
@@ -3920,6 +3920,7 @@ mod tests {
39203920
use util::config::UserConfig;
39213921
use util::test_utils;
39223922
use util::logger::Logger;
3923+
use util::rng;
39233924
use secp256k1::{Secp256k1,Message,Signature};
39243925
use secp256k1::key::{SecretKey,PublicKey};
39253926
use bitcoin_hashes::sha256::Hash as Sha256;
@@ -3987,7 +3988,7 @@ mod tests {
39873988
let their_node_id = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&secp_ctx, &[42; 32]).unwrap());
39883989
let mut config = UserConfig::new();
39893990
config.channel_options.announced_channel = false;
3990-
let mut chan = Channel::new_outbound(&feeest, &keys_provider, their_node_id, 10000000, 100000, 42, Arc::clone(&logger), &config).unwrap(); // Nothing uses their network key in this test
3991+
let mut chan = Channel::new_outbound(&feeest, &keys_provider, their_node_id,rng::rand_u832(), 10000000, 100000, 42, Arc::clone(&logger), &config).unwrap(); // Nothing uses their network key in this test
39913992
chan.their_to_self_delay = 144;
39923993
chan.our_dust_limit_satoshis = 546;
39933994

0 commit comments

Comments
 (0)