diff --git a/side-node/src/bitcoin/driver/htlc.rs b/side-node/src/bitcoin/driver/htlc.rs index ceafdf0..6ff28c3 100644 --- a/side-node/src/bitcoin/driver/htlc.rs +++ b/side-node/src/bitcoin/driver/htlc.rs @@ -11,18 +11,14 @@ pub(crate) async fn run() -> anyhow::Result<()> { // format a new commitment transaction like in Lightning let mut commitment_builder = dave.wallet.build_tx(); - let amount = 500; + let value = 500; let recipient = sammy.wallet.get_address(New)?.script_pubkey(); - let hash_preimage = utils::sha256("blah".to_string()); + let hash_preimage = "blah".to_string(); + let hashlock = utils::sha256(hash_preimage); - // Feed it 500 sats, a redeem identity, a hashlock, a refund timelock, and a refund identity + // Feed it a redeem identity, a hashlock from the preimage, a refund timelock, and a refund identity // - let htlc = bitcoin::htlc::Htlc::new( - dave.external_public_key, - hash_preimage, - 100, - sammy.external_public_key, - ); + let htlc = bitcoin::htlc::Htlc::new(dave.public_key, hashlock, 100, sammy.public_key); let htlc_descriptor = htlc.to_miniscript_descriptor(); tracing::info!("descriptor: {}", htlc_descriptor);