lib/zold/node/front.rb
# The minimum score required in order to recognize a requester
# as a valuable node and add it to the list of remotes.
The minimum score required in order to recognize a requester
as a valuable node and add it to the list of remotes.
The minimum score required in order to recognize a requester as a valuable node and add it to the list of remotes .
def add_new_remote(score)
      all = settings.remotes.all
      return if all.count > Remotes::MAX_NODES && all.none? { |r| r[:errors] > Remotes::TOLERANCE }
      begin
        require_relative '../commands/remote'
        Remote.new(remotes: settings.remotes, log: settings.log).run(
          [
            'remote', 'add', score.host, score.port.to_s,
            "--network=#{Shellwords.escape(settings.opts['network'])}", '--ignore-if-exists'
          ] + (settings.opts['ignore-score-weakness'] ? ['--skip-ping'] : [])
        )
      rescue StandardError => e
        error(400, e.message)
      end
    end
def add_new_remote ( score ) all = settings . remotes . all return if all . count > Remotes :: MAX_NODES && all . none? { | r | r [ :errors ] > Remotes :: TOLERANCE } begin require_relative '../commands/remote' Remote . new ( remotes : settings . remotes , log : settings . log ) . run ( [ 'remote' , 'add' , score . host , score . port . to_s , "--network=#{Shellwords.escape(settings.opts['network'])}" , '--ignore-if-exists' ] + ( settings . opts [ 'ignore-score-weakness' ] ? [ '--skip-ping' ] : [ ] ) ) rescue StandardError => e error ( 400 , e . message ) end end
The minimum score required in order to recognize a requester
as a valuable node and add it to the list of remotes.
The minimum score required in order to recognize a requester as a valuable node and add it to the list of remotes .
score
<not_specific>