@@ -31,11 +31,11 @@ use nimiq_mempool::config::MempoolConfig;
3131use nimiq_mempool_task:: MempoolTask ;
3232use nimiq_network_interface:: {
3333 network:: { MsgAcceptance , Network , NetworkEvent , SubscribeEvents } ,
34- request:: request_handler,
34+ request:: request_handler, validator_record :: ValidatorRecord ,
3535} ;
3636use nimiq_primitives:: { coin:: Coin , policy:: Policy } ;
3737use nimiq_transaction_builder:: TransactionBuilder ;
38- use nimiq_utils:: spawn;
38+ use nimiq_utils:: { spawn, tagged_signing :: { TaggedKeyPair , TaggedSignable , TaggedSigned } } ;
3939use nimiq_validator_network:: { PubsubId , ValidatorNetwork } ;
4040use parking_lot:: RwLock ;
4141#[ cfg( feature = "metrics" ) ]
@@ -366,6 +366,22 @@ where
366366 // Inform the network about the current validator ID.
367367 self . network . set_validator_id ( * self . slot_band . read ( ) ) ;
368368
369+ let key = self . signing_key ( ) ;
370+ let validator_address = self . validator_address ( ) ;
371+
372+ self . network . register_validator_signing_callback ( move |peer_id, timestamp| {
373+ let record = ValidatorRecord {
374+ timestamp,
375+ peer_id,
376+ validator_address : validator_address. clone ( ) ,
377+ } ;
378+
379+ let signature = key. tagged_sign ( & record) ;
380+
381+ TaggedSigned :: new ( record, signature)
382+ } ) ;
383+
384+
369385 // Set the elected validators of the current epoch in the network as well.
370386 self . network . set_validators ( validators) ;
371387
0 commit comments