@@ -39,15 +39,15 @@ use std::{
39
39
40
40
type FiniteAddrScore = u32 ;
41
41
42
- pub struct AutoNat {
42
+ pub struct Behaviour {
43
43
inner : RequestResponse < AutoNatCodec > ,
44
44
local_addresses : HashMap < Multiaddr , FiniteAddrScore > ,
45
45
pending_inbound : HashMap < PeerId , ResponseChannel < DialResponse > > ,
46
46
pending_outbound : HashSet < PeerId > ,
47
47
send_request : VecDeque < PeerId > ,
48
48
}
49
49
50
- impl Default for AutoNat {
50
+ impl Default for Behaviour {
51
51
fn default ( ) -> Self {
52
52
let protocols = iter:: once ( ( AutoNatProtocol , ProtocolSupport :: Full ) ) ;
53
53
let cfg = RequestResponseConfig :: default ( ) ;
@@ -62,15 +62,15 @@ impl Default for AutoNat {
62
62
}
63
63
}
64
64
65
- impl AutoNat {
65
+ impl Behaviour {
66
66
pub fn add_local_address ( & mut self , address : Multiaddr ) {
67
67
if self . local_addresses . get ( & address) . is_none ( ) {
68
68
self . local_addresses . insert ( address, 1 ) ;
69
69
}
70
70
}
71
71
}
72
72
73
- impl NetworkBehaviour for AutoNat {
73
+ impl NetworkBehaviour for Behaviour {
74
74
type ProtocolsHandler = <RequestResponse < AutoNatCodec > as NetworkBehaviour >:: ProtocolsHandler ;
75
75
type OutEvent = ( ) ;
76
76
@@ -222,7 +222,7 @@ impl NetworkBehaviour for AutoNat {
222
222
self . inner . inject_new_external_addr ( addr) ;
223
223
match self . local_addresses . get_mut ( addr) {
224
224
Some ( score) if * score == 0 => * score = 1 ,
225
- Some ( _) => { } ,
225
+ Some ( _) => { }
226
226
None => {
227
227
self . local_addresses . insert ( addr. clone ( ) , 1 ) ;
228
228
}
0 commit comments