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
963
963
fn get_dummy_channel_update ( short_chan_id : u64 ) -> msgs:: ChannelUpdate {
964
964
use bitcoin:: secp256k1:: ffi:: Signature as FFISignature ;
965
965
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
+
966
975
msgs:: ChannelUpdate {
967
976
signature : Signature :: from ( unsafe { FFISignature :: new ( ) } ) ,
968
977
contents : msgs:: UnsignedChannelUpdate {
969
978
chain_hash : ChainHash :: using_genesis_block ( network) ,
970
979
short_channel_id : short_chan_id,
971
- timestamp : 0 ,
980
+ timestamp : timestamp as u32 ,
972
981
message_flags : 1 , // Only must_be_one
973
982
channel_flags : 0 ,
974
983
cltv_expiry_delta : 0 ,
You can’t perform that action at this time.
0 commit comments