1. fixed a problem with DXLogPrint repeating log entries.
[spider.git] / perl / DXProt.pm
index 16b67023a7f09d579ff8bfd01ac2246f3188f74a..4cf7db7fae76c184b2f3b38e61bac3356a048d90 100644 (file)
@@ -371,9 +371,17 @@ sub normal
                }
                
                if ($pcno == 18) {              # link request
+                       $self->state('init');   
+
+                       # first clear out any nodes on this dxchannel
+                       my @gonenodes = map { $_->dxchan == $self ? $_ : () } DXNode::get_all();
+                       foreach my $node (@gonenodes) {
+                               next if $node->dxchan == $DXProt::me;
+                               broadcast_ak1a(pc21($node->call, 'Gone, re-init') , $self) unless $self->{isolate}; 
+                               $node->del();
+                       }
                        $self->send_local_config();
                        $self->send(pc20());
-                       $self->state('init');   
                        return;             # we don't pass these on
                }