// Make sure both is valid
assert(($ipPort[0] !== 'invalid') && ($ipPort[1] !== 'invalid'));
- // Add ip:port as criteria
+ // Add ip:port/node id as criteria
$searchInstance->addCriteria(self::DB_COLUMN_EXTERNAL_IP, $ipPort[0]);
$searchInstance->addCriteria(self::DB_COLUMN_LISTEN_PORT, $ipPort[1]);
+ $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID , $nodeInstance->getNodeId());
$searchInstance->setLimit(1);
// Query database and get a result instance back
);
// Make sure the chunk is not larger than a TCP package can hold
- assert(strlen($rawData) <= NetworkPackage::TCP_PACKAGE_SIZE);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': assert: ' . strlen($rawData) . '/' . NetworkPackage::TCP_PACKAGE_SIZE . ' ...');
+ // @TODO This assert broke packages where the hash chunk was very large: assert(strlen($rawData) <= NetworkPackage::TCP_PACKAGE_SIZE);
// Add it to the array
if ($prepend === true) {
*/
public function resetSerialNumber () {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('FRAGMENTER: Resetting serial number, previous=' . $this->serialNumber);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('FRAGMENTER: Resetting serial number, previous=' . $this->serialNumber);
// Reset serial number
$this->serialNumber = 0;