lib/zold/patch.rb in zold-0.13.35 vs lib/zold/patch.rb in zold-0.13.36
- old
+ new
@@ -67,10 +67,10 @@
if txn.amount.negative?
if txn.id <= max
@log.error("Transaction ID is not greater than max ID #{max}: #{txn.to_text}")
next
end
- dup = @txns.find { |t| t.id == txn.id }
+ dup = @txns.find { |t| t.id == txn.id && t.amount.negative? }
if dup
@log.error("An attempt to overwrite #{dup.to_text} with this: #{txn.to_text}")
next
end
if @txns.map(&:amount).map(&:to_i).inject(&:+).to_i < txn.amount.to_i * -1 && !wallet.root?