code: def guess_version(redeem_script):
      '''
      str -> int
      Bitcoin uses tx version 2 for nSequence signaling.
      Zcash uses tx version 2 for joinsplits.
  
      We want to signal nSequence if we're using OP_CSV.
      Unless we're in zcash.
      '''
      n = riemann.get_current_network_name()
      if 'sprout' in n:
          return 1
      if 'overwinter' in n:
          return 3
      if 'sapling' in n:
          return 4
      try:
          script_array = redeem_script.split()
          script_array.index('OP_CHECKSEQUENCEVERIFY')
          return 2
      except ValueError:
          return f guess_version(redeem_script):
      '''
      str -> int
      Bitcoin uses tx version 2 for nSequence signaling.
      Zcash uses tx version 2 for joinsplits.
  
      We want to signal nSequence if we're using OP_CSV.
      Unless we're in zcash.
      '''
      n = riemann.get_current_network_name()
      if 'sprout' in n:
          return 1
      if 'overwinter' in n:
          return 3
      if 'sapling' in n:
          return 4
      try:
          script_array = redeem_script.split()
          script_array.index('OP_CHECKSEQUENCEVERIFY')
          return 2
      except ValueError:
          return 1
docs: str -> int
      Bitcoin uses tx version 2 for nSequence signaling.
      Zcash uses tx version 2 for joinsplits.
  
      We want to signal nSequence if we're using OP_CSV.
      Unless we're in zcash.