lib/zold/commands/routines/reconcile.rb in zold-0.29.27 vs lib/zold/commands/routines/reconcile.rb in zold-0.29.28
- old
+ new
@@ -46,13 +46,18 @@
@remotes.iterate(@log) do |r|
next unless r.master?
next if r.to_mnemo == @address
res = r.http('/wallets').get
r.assert_code(200, res)
- res.body.strip.split("\n").compact
+ missing = res.body.strip.split("\n").compact
.select { |i| /^[a-f0-9]{16}$/.match?(i) }
.reject { |i| @wallets.acq(Zold::Id.new(i), &:exists?) }
- .each { |i| pull(i) }
+ missing.each { |i| pull(i) }
+ if missing.empty?
+ log.info("Nothing to reconcile with #{r}, we are good at #{@address}")
+ else
+ @log.info("Reconcile routine pulled #{missing.count} wallets from #{r}")
+ end
end
end
private