lib/rsync/rsync-utils.js
function maybeAddChecksumNode(path, nodeType, callback) {
    fsUtils.isPathUnsynced(fs, path, function(err, unsynced) {
      if(err) {
        return callback(err);
      }

      if(unsynced) {
        return callback();
      }

      getChecksum(fs, path, function(err, checksum) {
        if(err) {
          return callback(err);
        }
        // If we shouldn't add the checksum stamp or
        // the node does not exist (cannot add a stamp)
        // immediately add the checksum
        if(!stampNode || checksum === "") {
          return addChecksumNode(path, nodeType, checksum, callback);
        }

        // Stamp the node with the checksum
        fsUtils.setChecksum(fs, path, checksum, function(err) {
          if(err) {
            return callback(err);
          }

          addChecksumNode(path, nodeType, checksum, callback);
        });
      });
    });
  }
function maybeAddChecksumNode(path, nodeType, callback) {
    fsUtils.isPathUnsynced(fs, path, function(err, unsynced) {
      if(err) {
        return callback(err);
      }

      if(unsynced) {
        return callback();
      }

      getChecksum(fs, path, function(err, checksum) {
        if(err) {
          return callback(err);
        }
        // If we shouldn't add the checksum stamp or
        // the node does not exist (cannot add a stamp)
        // immediately add the checksum
        if(!stampNode || checksum === "") {
          return addChecksumNode(path, nodeType, checksum, callback);
        }

        // Stamp the node with the checksum
        fsUtils.setChecksum(fs, path, checksum, function(err) {
          if(err) {
            return callback(err);
          }

          addChecksumNode(path, nodeType, checksum, callback);
        });
      });
    });
  }
function maybeAddChecksumNode ( path , nodeType , callback ) { fsUtils . isPathUnsynced ( fs , path , function ( err , unsynced ) { if ( err ) { return callback ( err ) ; } if ( unsynced ) { return callback ( ) ; } getChecksum ( fs , path , function ( err , checksum ) { if ( err ) { return callback ( err ) ; } // If we shouldn't add the checksum stamp or // the node does not exist (cannot add a stamp) // immediately add the checksum if ( ! stampNode || checksum === "" ) { return addChecksumNode ( path , nodeType , checksum , callback ) ; } // Stamp the node with the checksum fsUtils . setChecksum ( fs , path , checksum , function ( err ) { if ( err ) { return callback ( err ) ; } addChecksumNode ( path , nodeType , checksum , callback ) ; } ) ; } ) ; } ) ; }
Only calculate the checksums for synced paths
Only calculate the checksums for synced paths