Commit 611b804a7f281674634002be58537955b3cc1f3b

Authored by Oleg Andreev
Committed by Julian Langschaedel
1 parent 1b5d1ca6b3

avoiding namespace issues when using Script from within itself

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

lib/bitcoin/script.rb
... ... @@ -670,7 +670,7 @@
670 670 # Accurate mode counts exact number of pubkeys required (not signatures, but pubkeys!). Only used in P2SH scripts.
671 671 # Inaccurate mode counts every multisig as 20 signatures.
672 672 if is_accurate && last_opcode && last_opcode.is_a?(Fixnum) && last_opcode >= OP_1 && last_opcode <= OP_16
673   - count += Script.decode_OP_N(last_opcode)
  673 + count += ::Bitcoin::Script.decode_OP_N(last_opcode)
674 674 else
675 675 count += 20
676 676 end
... ... @@ -704,7 +704,7 @@
704 704 end
705 705 return 0 if data == ""
706 706  
707   - Script.new(data).sigops_count_accurate(true)
  707 + ::Bitcoin::Script.new(data).sigops_count_accurate(true)
708 708 end
709 709  
710 710 # Converts OP_{0,1,2,...,16} into 0, 1, 2, ..., 16.
... ... @@ -1160,7 +1160,7 @@
1160 1160  
1161 1161 def sighash_subscript(drop_sigs)
1162 1162 if inner_p2sh? && @inner_script_code
1163   - Bitcoin::Script.new(@inner_script_code).to_binary_without_signatures(drop_sigs)
  1163 + ::Bitcoin::Script.new(@inner_script_code).to_binary_without_signatures(drop_sigs)
1164 1164 else
1165 1165 to_binary_without_signatures(drop_sigs)
1166 1166 end