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
let feerate = fee_estimator.get_est_sat_per_vbyte(ConfirmationTarget::Normal);
358
358
let background_feerate = fee_estimator.get_est_sat_per_vbyte(ConfirmationTarget::Background);
359
359
360
-
letmut key_seed = [0u8;32];
361
-
rng::fill_bytes(&mut key_seed);
362
-
let chan_keys = matchChannelKeys::new_from_seed(&key_seed){
363
-
Ok(key) => key,
364
-
Err(_) => panic!("RNG is busted!")
365
-
};
366
-
367
360
let secp_ctx = Secp256k1::new();
368
361
let our_channel_monitor_claim_key_hash = Hash160::from_data(&PublicKey::from_secret_key(&secp_ctx,&chan_keys.channel_monitor_claim_key).unwrap().serialize());
369
362
let our_channel_monitor_claim_script = Builder::new().push_opcode(opcodes::All::OP_PUSHBYTES_0).push_slice(&our_channel_monitor_claim_key_hash[..]).into_script();
@@ -439,7 +432,7 @@ impl Channel {
439
432
/// Assumes chain_hash has already been checked and corresponds with what we expect!
440
433
/// Generally prefers to take the DisconnectPeer action on failure, as a notice to the sender
returnErr(HandleError{err:"funding value > 2^24",msg:Some(msgs::ErrorAction::DisconnectPeer{})});
@@ -479,13 +472,6 @@ impl Channel {
479
472
480
473
let background_feerate = fee_estimator.get_est_sat_per_vbyte(ConfirmationTarget::Background);
481
474
482
-
letmut key_seed = [0u8;32];
483
-
rng::fill_bytes(&mut key_seed);
484
-
let chan_keys = matchChannelKeys::new_from_seed(&key_seed){
485
-
Ok(key) => key,
486
-
Err(_) => panic!("RNG is busted!")
487
-
};
488
-
489
475
let secp_ctx = Secp256k1::new();
490
476
let our_channel_monitor_claim_key_hash = Hash160::from_data(&PublicKey::from_secret_key(&secp_ctx,&chan_keys.channel_monitor_claim_key).unwrap().serialize());
491
477
let our_channel_monitor_claim_script = Builder::new().push_opcode(opcodes::All::OP_PUSHBYTES_0).push_slice(&our_channel_monitor_claim_key_hash[..]).into_script();
@@ -2303,7 +2289,7 @@ mod tests {
2303
2289
use bitcoin::util::bip143;
2304
2290
use bitcoin::network::serialize::serialize;
2305
2291
use bitcoin::blockdata::transaction::Transaction;
2306
-
use ln::channel::{Channel,HTLCOutput,HTLCState,HTLCOutputInCommitment,TxCreationKeys};
2292
+
use ln::channel::{Channel,ChannelKeys,HTLCOutput,HTLCState,HTLCOutputInCommitment,TxCreationKeys};
2307
2293
use ln::chan_utils;
2308
2294
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
2309
2295
use secp256k1::{Secp256k1,Message,Signature};
@@ -2324,20 +2310,26 @@ mod tests {
2324
2310
fnoutbound_commitment_test(){
2325
2311
// Test vectors from BOLT 3 Appendix C:
2326
2312
let feeest = TestFeeEstimator{fee_est:15000/250};
2327
-
letmut chan = Channel::new_outbound(&feeest,PublicKey::new(),10000000,false,42);// Nothing uses their network key in this test
0 commit comments