Skip to content

Commit

Permalink
activate known tx exceptions again
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanne committed Sep 13, 2012
1 parent 8f3ab4d commit ae27844
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bitcoin/validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ class Tx
# rules:: which rulesets to validate (default: [:syntax, :context])
# raise_errors:: whether to raise ValidationError on failure (default: false)
def validate(opts = {})
return true if matches_known_exception
opts[:rules] ||= [:syntax, :context]

opts[:rules].each do |name|
store.log.info { "validating tx #{name} #{tx.hash} (#{tx.to_payload.bytesize} bytes)" }
RULES[name].each.with_index do |rule, i|
unless send(rule)
raise ValidationError, "#tx error: #{name} check #{i} - #{rule} failed" if opts[:raise_errors]
raise ValidationError, "tx error: #{name} check #{i} - #{rule} failed" if opts[:raise_errors]
return false
end
end
Expand Down

0 comments on commit ae27844

Please sign in to comment.