diff --git a/src/ckb/tests/test_utils.rs b/src/ckb/tests/test_utils.rs index b9fcd7310..f47a8166c 100644 --- a/src/ckb/tests/test_utils.rs +++ b/src/ckb/tests/test_utils.rs @@ -472,6 +472,7 @@ impl Actor for MockChainActor { } } TraceTx(tx, reply_port) => { + debug!("Tracing transaction: {:?}", &tx); match state.tx_status.get(&tx.tx_hash).cloned() { Some((tx_view, status)) => { reply_trace_tx(Some(tx_view), status, reply_port); diff --git a/src/fiber/channel.rs b/src/fiber/channel.rs index 43e1b75f6..9c09dedac 100644 --- a/src/fiber/channel.rs +++ b/src/fiber/channel.rs @@ -1,8 +1,10 @@ #[cfg(debug_assertions)] use crate::fiber::network::DebugEvent; -use crate::{debug_event, fiber::serde_utils::U64Hex}; +use crate::{ + debug_event, + fiber::{serde_utils::U64Hex, types::BroadcastMessageWithTimestamp}, +}; use bitflags::bitflags; -use ckb_jsonrpc_types::BlockNumber; use futures::future::OptionFuture; use secp256k1::XOnlyPublicKey; use tracing::{debug, error, info, trace, warn}; @@ -25,7 +27,7 @@ use crate::{ }, serde_utils::{CompactSignatureAsBytes, EntityHex, PubNonceAsBytes}, types::{ - AcceptChannel, AddTlc, AnnouncementSignatures, BroadcastMessage, BroadcastMessageQuery, + AcceptChannel, AddTlc, AnnouncementSignatures, BroadcastMessageQuery, BroadcastMessageQueryFlags, ChannelAnnouncement, ChannelReady, ChannelUpdate, ClosingSigned, CommitmentSigned, EcdsaSignature, FiberChannelMessage, FiberMessage, Hash256, OpenChannel, PaymentOnionPacket, PeeledPaymentOnionPacket, Privkey, Pubkey, @@ -47,6 +49,7 @@ use ckb_types::{ }, packed::{Bytes, CellInput, CellOutput, OutPoint, Script, Transaction}, prelude::{AsTransactionBuilder, IntoTransactionView, Pack, Unpack}, + H256, }; use molecule::prelude::{Builder, Entity}; use musig2::{ @@ -1709,7 +1712,7 @@ where event: ChannelEvent, ) -> Result<(), ProcessingChannelError> { match event { - ChannelEvent::FundingTransactionConfirmed(block_number, tx_index) => { + ChannelEvent::FundingTransactionConfirmed(block_hash, tx_index, timestamp) => { debug!("Funding transaction confirmed"); let flags = match state.state { ChannelState::AwaitingChannelReady(flags) => flags, @@ -1723,7 +1726,7 @@ where "Expecting funding transaction confirmed event in state AwaitingChannelReady or after TX_SIGNATURES_SENT, but got state {:?}", &state.state))); } }; - state.funding_tx_confirmed_at = Some((block_number, tx_index)); + state.funding_tx_confirmed_at = Some((block_hash, tx_index, timestamp)); self.network .send_message(NetworkActorMessage::new_command( NetworkActorCommand::SendFiberMessage(FiberMessageWithPeerId::new( @@ -1766,7 +1769,7 @@ where self.network .send_message(NetworkActorMessage::new_command( NetworkActorCommand::BroadcastMessages(vec![ - BroadcastMessage::ChannelUpdate(update), + BroadcastMessageWithTimestamp::ChannelUpdate(update), ]), )) .expect(ASSUME_NETWORK_ACTOR_ALIVE); @@ -2766,7 +2769,7 @@ pub struct ChannelActorState { #[serde_as(as = "Option")] pub funding_tx: Option, - pub funding_tx_confirmed_at: Option<(BlockNumber, u32)>, + pub funding_tx_confirmed_at: Option<(H256, u32, u64)>, #[serde_as(as = "Option")] pub funding_udt_type_script: Option