zold 0.16.21 → 0.16.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9ed770c6f66e7627f1c23329a2ad5723c1d9ea8dd714db3341fcb48645597c9
4
- data.tar.gz: 4055ca5daecab2762c3155406c597550188223e2358b1908dd5ed8240a4159a4
3
+ metadata.gz: 25ddd38e296465dbb600bfd58681aacb8a957f683bf33c7a9fe29e5ba02fbf90
4
+ data.tar.gz: db0590b2def1d612b9e21d4e40ca4c11260c04b622431e8132af8e29f602ced5
5
5
  SHA512:
6
- metadata.gz: 7ebc0ae599f38f53b31fd85b30e5beb2cb97c517dff0bd4a1ddb01b3d9e4b2138ed3fa8dfdf0ec741309ba0ed0eabe95b23703d985b48870c5b305ea1966fe7f
7
- data.tar.gz: 7fb53797974d1af0adbfa2a19d99fc6e8c31e70c326c4a4b24b231d61fad6cd58c6d6a43b574d4b6efebec3f65eb1940f72a7db3c457a31f0ce84683a3d481e0
6
+ metadata.gz: bac8ee84186954992bb51ad8e89f7c75efb8a65c014ec8ca48603abc5c7cf9e5b4d16a33aa7c466b30ca6b0004e3c3b170369cf9da56eb4accc34774d201cc50
7
+ data.tar.gz: 1065f0c6ae8d17c8c714277c80b65e4ba0bfe34745e53e41200562884d1984af22f91f840182114306a53b31b3859173bc00239d9e61b171dceb3118821c300a
@@ -127,9 +127,8 @@ Available options:"
127
127
  raise "The balance of #{id} is #{wallet.balance} and it's not a root wallet"
128
128
  end
129
129
  copy = cps.add(IO.read(f), score.host, score.port, score.value)
130
- @log.info("#{r} returned #{Size.new(body.length)} #{wallet.mnemo} \
131
- #{digest(json)}/#{Age.new(json['mtime'])}/#{json['copies']}c \
132
- as copy #{copy} of #{id} in #{Age.new(start, limit: 4)}: #{Rainbow(score.value).green} (#{json['version']})")
130
+ @log.info("#{r} returned #{wallet.mnemo} #{Age.new(json['mtime'])}/#{json['copies']}c \
131
+ as copy ##{copy} in #{Age.new(start, limit: 4)}: #{Rainbow(score.value).green} (#{json['version']})")
133
132
  end
134
133
  score.value
135
134
  end
@@ -71,14 +71,10 @@ module Zold
71
71
  end
72
72
  wallet.txns.each do |txn|
73
73
  next if @txns.find { |t| t == txn }
74
- if @txns.find { |t| t.id == txn.id && t.bnf == txn.bnf }
75
- @log.error("A transaction with the same ID #{t.id} and BNF #{t.bnf} already exists")
76
- next
77
- end
78
74
  if txn.amount.negative?
79
75
  dup = @txns.find { |t| t.id == txn.id && t.amount.negative? }
80
76
  if dup
81
- @log.error("An attempt to overwrite #{dup.to_text} with this: #{txn.to_text}")
77
+ @log.error("An attempt to overwrite \"#{dup.to_text}\" with \"#{txn.to_text}\" from #{wallet.mnemo}")
82
78
  next
83
79
  end
84
80
  balance = @txns.map(&:amount).map(&:to_i).inject(&:+).to_i
@@ -92,6 +88,11 @@ module Zold
92
88
  next
93
89
  end
94
90
  else
91
+ dup = @txns.find { |t| t.id == txn.id && t.bnf == txn.bnf && t.amount.positive? }
92
+ if dup
93
+ @log.error("Overwriting \"#{dup.to_text}\" with \"#{txn.to_text}\" from #{wallet.mnemo} (same ID/BNF)")
94
+ next
95
+ end
95
96
  if !txn.sign.nil? && !txn.sign.empty?
96
97
  @log.error("RSA signature is redundant at ##{txn.id} of #{wallet.id}: #{txn.to_text}")
97
98
  next
@@ -25,6 +25,6 @@
25
25
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module Zold
28
- VERSION = '0.16.21'
28
+ VERSION = '0.16.22'
29
29
  PROTOCOL = 2
30
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.21
4
+ version: 0.16.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko