File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -963,12 +963,21 @@ fn get_dummy_channel_announcement(short_chan_id: u64) -> msgs::ChannelAnnounceme
963963fn get_dummy_channel_update ( short_chan_id : u64 ) -> msgs:: ChannelUpdate {
964964 use bitcoin:: secp256k1:: ffi:: Signature as FFISignature ;
965965 let network = Network :: Testnet ;
966+
967+ #[ allow( unused_mut, unused_assignments) ]
968+ let mut timestamp = 0 ;
969+ #[ cfg( feature = "std" ) ]
970+ {
971+ use std:: time:: { SystemTime , UNIX_EPOCH } ;
972+ timestamp = SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . expect ( "Time must be > 1970" ) . as_secs ( ) - 60 * 60 * 24 * 7 * 2 ;
973+ }
974+
966975 msgs:: ChannelUpdate {
967976 signature : Signature :: from ( unsafe { FFISignature :: new ( ) } ) ,
968977 contents : msgs:: UnsignedChannelUpdate {
969978 chain_hash : ChainHash :: using_genesis_block ( network) ,
970979 short_channel_id : short_chan_id,
971- timestamp : 0 ,
980+ timestamp : timestamp as u32 ,
972981 message_flags : 1 , // Only must_be_one
973982 channel_flags : 0 ,
974983 cltv_expiry_delta : 0 ,
You can’t perform that action at this time.
0 commit comments