zold 0.16.21 → 0.16.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zold/commands/fetch.rb +2 -3
- data/lib/zold/patch.rb +6 -5
- data/lib/zold/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25ddd38e296465dbb600bfd58681aacb8a957f683bf33c7a9fe29e5ba02fbf90
|
4
|
+
data.tar.gz: db0590b2def1d612b9e21d4e40ca4c11260c04b622431e8132af8e29f602ced5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bac8ee84186954992bb51ad8e89f7c75efb8a65c014ec8ca48603abc5c7cf9e5b4d16a33aa7c466b30ca6b0004e3c3b170369cf9da56eb4accc34774d201cc50
|
7
|
+
data.tar.gz: 1065f0c6ae8d17c8c714277c80b65e4ba0bfe34745e53e41200562884d1984af22f91f840182114306a53b31b3859173bc00239d9e61b171dceb3118821c300a
|
data/lib/zold/commands/fetch.rb
CHANGED
@@ -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 #{
|
131
|
-
|
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
|
data/lib/zold/patch.rb
CHANGED
@@ -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
|
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
|
data/lib/zold/version.rb
CHANGED