Skip to content

Commit

Permalink
#402 extra check
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 16, 2018
1 parent 4a17f59 commit ff712af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/zold/patch.rb
Expand Up @@ -72,6 +72,10 @@ def join(wallet, baseline = true)
end
wallet.txns.each do |txn|
next if @txns.find { |t| t == txn }
if @txns.find { |t| t.id == txn.id && t.bnf == txn.bnf }
@log.error("A transaction with the same ID #{t.id} and BNF #{t.bnf} already exists")
next
end
if txn.amount.negative?
dup = @txns.find { |t| t.id == txn.id && t.amount.negative? }
if dup
Expand Down

0 comments on commit ff712af

Please sign in to comment.