fw: use dead Nonce list in pipelines

refs #1953

Change-Id: I0faef2a985b03fe96387c2e0181588713550b9ce
diff --git a/daemon/table/pit-entry.cpp b/daemon/table/pit-entry.cpp
index e089a09..35cc2e0 100644
--- a/daemon/table/pit-entry.cpp
+++ b/daemon/table/pit-entry.cpp
@@ -126,10 +126,38 @@
   return false;
 }
 
-bool
-Entry::addNonce(uint32_t nonce)
+int
+Entry::findNonce(uint32_t nonce, const Face& face) const
 {
-  return m_nonceList.add(nonce);
+  // TODO should we ignore expired in/out records?
+
+  int dnw = DUPLICATE_NONCE_NONE;
+
+  for (InRecordCollection::const_iterator it = m_inRecords.begin();
+       it != m_inRecords.end(); ++it) {
+    if (it->getLastNonce() == nonce) {
+      if (it->getFace().get() == &face) {
+        dnw |= DUPLICATE_NONCE_IN_SAME;
+      }
+      else {
+        dnw |= DUPLICATE_NONCE_IN_OTHER;
+      }
+    }
+  }
+
+  for (OutRecordCollection::const_iterator it = m_outRecords.begin();
+       it != m_outRecords.end(); ++it) {
+    if (it->getLastNonce() == nonce) {
+      if (it->getFace().get() == &face) {
+        dnw |= DUPLICATE_NONCE_OUT_SAME;
+      }
+      else {
+        dnw |= DUPLICATE_NONCE_OUT_OTHER;
+      }
+    }
+  }
+
+  return dnw;
 }
 
 InRecordCollection::iterator
@@ -170,7 +198,6 @@
   }
 
   it->update(interest);
-  m_nonceList.add(interest.getNonce());
   return it;
 }