Changeset 2039


Ignore:
Timestamp:
Oct 30, 2010, 1:34:40 PM (11 years ago)
Author:
Sven Rech
Message:

keysearcher:

some debugging messages for FindNextLeaf process. (I will revert these changes later)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/P2P/Tree/KeyPoolTree.cs

    r2024 r2039  
    6363
    6464            var nodeBeforeStarting = currentNode;
     65            keySearcher.GuiLogMessage("Calling FindNextLeaf(SearchOption.SkipReservedLeafs) now!", NotificationLevel.Debug);
    6566            var foundNode = FindNextLeaf(SearchOption.SkipReservedLeafs);
     67            keySearcher.GuiLogMessage("Returned from FindNextLeaf(SearchOption.SkipReservedLeafs)...", NotificationLevel.Debug);
     68            if (foundNode == null)
     69                keySearcher.GuiLogMessage("FindNextLeaf(SearchOption.SkipReservedLeafs) returned null!", NotificationLevel.Debug);
     70            if (skippedReservedNodes)
     71                keySearcher.GuiLogMessage("FindNextLeaf(SearchOption.SkipReservedLeafs) skipped reserved nodes!", NotificationLevel.Debug);
    6672
    6773            if (foundNode == null && skippedReservedNodes)
     
    8793        {
    8894            if (currentNode == null)
     95            {
     96                keySearcher.GuiLogMessage("Inside FindNextLeaf: currentNode is null!", NotificationLevel.Debug);
    8997                return null;
     98            }
    9099
    91100            var isReserved = false;
    92101            var useReservedLeafs = useReservedLeafsOption == SearchOption.UseReservedLeafs;
    93102
     103            keySearcher.GuiLogMessage("Inside FindNextLeaf: updating currentNode now!", NotificationLevel.Debug);
    94104            storageHelper.UpdateFromDht(currentNode, true);
    95105            currentNode.UpdateCache();
     106            keySearcher.GuiLogMessage("Inside FindNextLeaf: Now entering while loop!", NotificationLevel.Debug);
    96107            while (currentNode.IsCalculated() || (!useReservedLeafs && (isReserved = currentNode.IsReserved())))
    97108            {
    98109                if (isReserved)
     110                {
     111                    keySearcher.GuiLogMessage("Inside FindNextLeaf: currentNode was reserved!", NotificationLevel.Debug);
    99112                    skippedReservedNodes = true;
     113                }
     114                if (currentNode.IsCalculated())
     115                    keySearcher.GuiLogMessage("Inside FindNextLeaf: currentNode is already calculated!", NotificationLevel.Debug);
    100116
    101117                // Current node is calculated or reserved,
    102118                // move one node up and update it
     119                keySearcher.GuiLogMessage("Inside FindNextLeaf: set currentNode to its own parent!", NotificationLevel.Debug);
    103120                currentNode = currentNode.ParentNode;
    104121
     
    106123                if (currentNode == null)
    107124                {
     125                    keySearcher.GuiLogMessage("Inside FindNextLeaf: parent was null, so set currentNode to rootNode!", NotificationLevel.Debug);
    108126                    currentNode = rootNode;
    109127                    return null;
    110128                }
    111129
     130                keySearcher.GuiLogMessage("Inside FindNextLeaf: updating currentNode now!", NotificationLevel.Debug);
    112131                // Update the new _currentNode
    113132                storageHelper.UpdateFromDht(currentNode, true);
     
    115134            }
    116135
     136            keySearcher.GuiLogMessage("Inside FindNextLeaf: Exiting loop! Updating currentNode!", NotificationLevel.Debug);
    117137            // currentNode is calculateable => find leaf
    118138            currentNode.UpdateCache();
Note: See TracChangeset for help on using the changeset viewer.