lib/zold/commands/push.rb in zold-0.11.4 vs lib/zold/commands/push.rb in zold-0.11.5
- old
+ new
@@ -75,22 +75,22 @@
if opts['ignore-node'].include?(r.to_s)
@log.info("#{r} ignored because of --ignore-node")
return 0
end
start = Time.now
- response = r.http(
- "/wallet/#{wallet.id}#{opts['sync'] ? '?sync=true' : ''}"
- ).put(File.read(wallet.path))
+ content = File.read(wallet.path)
+ response = r.http("/wallet/#{wallet.id}#{opts['sync'] ? '?sync=true' : ''}").put(content)
if response.code == '304'
@log.info("#{r}: same version of #{wallet.id} there")
return 0
end
r.assert_code(200, response)
json = JSON.parse(response.body)['score']
score = Score.parse_json(json)
r.assert_valid_score(score)
raise "Score is too weak #{score}" if score.strength < Score::STRENGTH
- @log.info("#{r} accepted #{wallet.id} in #{(Time.now - start).round(2)}s: #{Rainbow(score.value).green}")
+ @log.info("#{r} accepted #{content.length}b/#{wallet.txns.count}txns of #{wallet.id} \
+in #{(Time.now - start).round(2)}s: #{Rainbow(score.value).green} (#{json['version']})")
score.value
end
end
end