Skip to content

Commit f3e44fc

Browse files
Update to latest rust-lightning splicing API
1 parent c9218c0 commit f3e44fc

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/lib.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,11 +1335,11 @@ impl Node {
13351335

13361336
let change_address = self.wallet.get_new_internal_address()?;
13371337

1338-
let contribution = SpliceContribution::splice_in(
1339-
Amount::from_sat(splice_amount_sats),
1338+
let contribution = SpliceContribution::SpliceIn {
1339+
value: Amount::from_sat(splice_amount_sats),
13401340
inputs,
1341-
Some(change_address.script_pubkey()),
1342-
);
1341+
change_script: Some(change_address.script_pubkey()),
1342+
};
13431343

13441344
let funding_feerate_per_kw: u32 = match fee_rate.to_sat_per_kwu().try_into() {
13451345
Ok(fee_rate) => fee_rate,
@@ -1411,10 +1411,12 @@ impl Node {
14111411

14121412
self.wallet.parse_and_validate_address(address)?;
14131413

1414-
let contribution = SpliceContribution::splice_out(vec![bitcoin::TxOut {
1415-
value: Amount::from_sat(splice_amount_sats),
1416-
script_pubkey: address.script_pubkey(),
1417-
}]);
1414+
let contribution = SpliceContribution::SpliceOut {
1415+
outputs: vec![bitcoin::TxOut {
1416+
value: Amount::from_sat(splice_amount_sats),
1417+
script_pubkey: address.script_pubkey(),
1418+
}],
1419+
};
14181420

14191421
let fee_rate = self.fee_estimator.estimate_fee_rate(ConfirmationTarget::ChannelFunding);
14201422
let funding_feerate_per_kw: u32 = match fee_rate.to_sat_per_kwu().try_into() {

0 commit comments

Comments
 (0)