// Have your wallet put the inputs into the transaction such that the output is
// satisfied.
let funded_tx = bitcoind_client.fund_raw_transaction(raw_tx).await;
- let change_output_position = funded_tx.changepos;
- assert!(change_output_position == 0 || change_output_position == 1);
// Sign the final funding transaction and broadcast it.
let signed_tx = bitcoind_client.sign_raw_transaction_with_wallet(funded_tx.hex).await;
payment.status = HTLCStatus::Failed;
}
}
+ Event::PaymentForwarded { fee_earned_msat, claim_from_onchain_tx } => {
+ let from_onchain_str = if claim_from_onchain_tx {
+ "from onchain downstream claim"
+ } else {
+ "from HTLC fulfill message"
+ };
+ if let Some(fee_earned) = fee_earned_msat {
+ println!(
+ "\nEVENT: Forwarded payment, earning {} msat {}",
+ fee_earned, from_onchain_str
+ );
+ } else {
+ println!("\nEVENT: Forwarded payment, claiming onchain {}", from_onchain_str);
+ }
+ print!("> ");
+ io::stdout().flush().unwrap();
+ }
Event::PendingHTLCsForwardable { time_forwardable } => {
let forwarding_channel_manager = channel_manager.clone();
tokio::spawn(async move {