Skip to content
68 changes: 24 additions & 44 deletions fuzz/src/chanmon_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1860,11 +1860,8 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {

0xa0 => {
let input = FundingTxInput::new_p2wpkh(coinbase_tx.clone(), 0).unwrap();
let contribution = SpliceContribution::SpliceIn {
value: Amount::from_sat(10_000),
inputs: vec![input],
change_script: None,
};
let contribution =
SpliceContribution::splice_in(Amount::from_sat(10_000), vec![input], None);
let funding_feerate_sat_per_kw = fee_est_a.ret_val.load(atomic::Ordering::Acquire);
if let Err(e) = nodes[0].splice_channel(
&chan_a_id,
Expand All @@ -1882,11 +1879,8 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
},
0xa1 => {
let input = FundingTxInput::new_p2wpkh(coinbase_tx.clone(), 1).unwrap();
let contribution = SpliceContribution::SpliceIn {
value: Amount::from_sat(10_000),
inputs: vec![input],
change_script: None,
};
let contribution =
SpliceContribution::splice_in(Amount::from_sat(10_000), vec![input], None);
let funding_feerate_sat_per_kw = fee_est_b.ret_val.load(atomic::Ordering::Acquire);
if let Err(e) = nodes[1].splice_channel(
&chan_a_id,
Expand All @@ -1904,11 +1898,8 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
},
0xa2 => {
let input = FundingTxInput::new_p2wpkh(coinbase_tx.clone(), 0).unwrap();
let contribution = SpliceContribution::SpliceIn {
value: Amount::from_sat(10_000),
inputs: vec![input],
change_script: None,
};
let contribution =
SpliceContribution::splice_in(Amount::from_sat(10_000), vec![input], None);
let funding_feerate_sat_per_kw = fee_est_b.ret_val.load(atomic::Ordering::Acquire);
if let Err(e) = nodes[1].splice_channel(
&chan_b_id,
Expand All @@ -1926,11 +1917,8 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
},
0xa3 => {
let input = FundingTxInput::new_p2wpkh(coinbase_tx.clone(), 1).unwrap();
let contribution = SpliceContribution::SpliceIn {
value: Amount::from_sat(10_000),
inputs: vec![input],
change_script: None,
};
let contribution =
SpliceContribution::splice_in(Amount::from_sat(10_000), vec![input], None);
let funding_feerate_sat_per_kw = fee_est_c.ret_val.load(atomic::Ordering::Acquire);
if let Err(e) = nodes[2].splice_channel(
&chan_b_id,
Expand Down Expand Up @@ -1958,12 +1946,10 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
.map(|chan| chan.outbound_capacity_msat)
.unwrap();
if outbound_capacity_msat >= 20_000_000 {
let contribution = SpliceContribution::SpliceOut {
outputs: vec![TxOut {
value: Amount::from_sat(MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS),
script_pubkey: coinbase_tx.output[0].script_pubkey.clone(),
}],
};
let contribution = SpliceContribution::splice_out(vec![TxOut {
value: Amount::from_sat(MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS),
script_pubkey: coinbase_tx.output[0].script_pubkey.clone(),
}]);
let funding_feerate_sat_per_kw =
fee_est_a.ret_val.load(atomic::Ordering::Acquire);
if let Err(e) = nodes[0].splice_channel(
Expand All @@ -1989,12 +1975,10 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
.map(|chan| chan.outbound_capacity_msat)
.unwrap();
if outbound_capacity_msat >= 20_000_000 {
let contribution = SpliceContribution::SpliceOut {
outputs: vec![TxOut {
value: Amount::from_sat(MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS),
script_pubkey: coinbase_tx.output[1].script_pubkey.clone(),
}],
};
let contribution = SpliceContribution::splice_out(vec![TxOut {
value: Amount::from_sat(MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS),
script_pubkey: coinbase_tx.output[1].script_pubkey.clone(),
}]);
let funding_feerate_sat_per_kw =
fee_est_b.ret_val.load(atomic::Ordering::Acquire);
if let Err(e) = nodes[1].splice_channel(
Expand All @@ -2020,12 +2004,10 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
.map(|chan| chan.outbound_capacity_msat)
.unwrap();
if outbound_capacity_msat >= 20_000_000 {
let contribution = SpliceContribution::SpliceOut {
outputs: vec![TxOut {
value: Amount::from_sat(MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS),
script_pubkey: coinbase_tx.output[1].script_pubkey.clone(),
}],
};
let contribution = SpliceContribution::splice_out(vec![TxOut {
value: Amount::from_sat(MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS),
script_pubkey: coinbase_tx.output[1].script_pubkey.clone(),
}]);
let funding_feerate_sat_per_kw =
fee_est_b.ret_val.load(atomic::Ordering::Acquire);
if let Err(e) = nodes[1].splice_channel(
Expand All @@ -2051,12 +2033,10 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
.map(|chan| chan.outbound_capacity_msat)
.unwrap();
if outbound_capacity_msat >= 20_000_000 {
let contribution = SpliceContribution::SpliceOut {
outputs: vec![TxOut {
value: Amount::from_sat(MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS),
script_pubkey: coinbase_tx.output[2].script_pubkey.clone(),
}],
};
let contribution = SpliceContribution::splice_out(vec![TxOut {
value: Amount::from_sat(MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS),
script_pubkey: coinbase_tx.output[2].script_pubkey.clone(),
}]);
let funding_feerate_sat_per_kw =
fee_est_c.ret_val.load(atomic::Ordering::Acquire);
if let Err(e) = nodes[2].splice_channel(
Expand Down
10 changes: 4 additions & 6 deletions lightning-tests/src/upgrade_downgrade_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,10 @@ fn do_test_0_1_htlc_forward_after_splice(fail_htlc: bool) {
reconnect_b_c_args.send_announcement_sigs = (true, true);
reconnect_nodes(reconnect_b_c_args);

let contribution = SpliceContribution::SpliceOut {
outputs: vec![TxOut {
value: Amount::from_sat(1_000),
script_pubkey: nodes[0].wallet_source.get_change_script().unwrap(),
}],
};
let contribution = SpliceContribution::splice_out(vec![TxOut {
value: Amount::from_sat(1_000),
script_pubkey: nodes[0].wallet_source.get_change_script().unwrap(),
}]);
let splice_tx = splice_channel(&nodes[0], &nodes[1], ChannelId(chan_id_bytes_a), contribution);
for node in nodes.iter() {
mine_transaction(node, &splice_tx);
Expand Down
Loading