lib/zold/commands/fetch.rb in zold-0.13.11 vs lib/zold/commands/fetch.rb in zold-0.13.12

- old
+ new

@@ -65,15 +65,16 @@ private def fetch(id, cps, opts) total = 0 + nodes = 0 @remotes.iterate(@log) do |r| - fetch_one(id, r, cps, opts) - total += 1 + total += fetch_one(id, r, cps, opts) + nodes += 1 end - @log.debug("#{total} copies of #{id} fetched, there are #{cps.all.count} available locally") + @log.debug("#{nodes} copies of #{id} fetched for the total score of #{total}, #{cps.all.count} local copies") end def fetch_one(id, r, cps, opts) start = Time.now if opts['ignore-node'].include?(r.to_s) @@ -95,8 +96,9 @@ wallet = Wallet.new(f.path) cps.add(body, score.host, score.port, score.value) @log.info("#{r} returned #{body.length}b/#{wallet.txns.count}t \ of #{id} in #{(Time.now - start).round(2)}s: #{Rainbow(score.value).green} (#{json['version']})") end + score.value end end end