fixed Route::findroutes
[spider.git] / perl / Route.pm
index 1106892a167c8641147ac76fa02d9118a13057eb..d4fb95d4205eae5143959c9c6efd130b0da1eb43 100644 (file)
@@ -298,15 +298,15 @@ sub findroutes
        return () if $seen->{$call};
        if (my $dxchan = DXChannel::get($call)) {
                $seen->{$call}++;
-               push @out, [$level, $dxchan];
+               push @out, $level ? [$level, $dxchan] : $dxchan;
                return @out;
        }
 
        # deal with more nodes
-       my $nref = Route::Node::get($call);
-       foreach my $ncall (@{$nref->{nodes}}) {
+       my $nref = Route::get($call);
+       foreach my $ncall (@{$nref->{parent}}) {
                dbg("recursing from $call -> $ncall") if isdbg('routec');
-               my @rout = findroute($ncall, $level+1, $seen);
+               my @rout = findroutes($ncall, $level+1, $seen);
                push @out, @rout;
        }