Sha256: b8ddde9bf0c85464c8930dc079f3704cf2f2995fc9e053d764cb3af3e2ff1f1b

Contents?: true

Size: 632 Bytes

Versions: 6

Compression:

Stored size: 632 Bytes

Contents

# encoding: ascii-8bit

module Bitcoin
  module Protocol

    class Handler
      def on_inv_transaction(hash)
        p ['inv transaction', hash.hth]
      end

      def on_inv_block(hash)
        p ['inv block', hash.hth]
      end

      def on_get_transaction(hash)
        p ['get transaction', hash.hth]
      end

      def on_get_block(hash)
        p ['get block', hash.hth]
      end

      def on_addr(addr)
        p ['addr', addr, addr.alive?]
      end

      def on_tx(tx)
        p ['tx', tx]
      end

      def on_block(block)
        #p ['block', block]
        puts block.to_json
      end

    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bitcoin-ruby-0.0.7 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.6 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.5 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.4 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.3 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.2 lib/bitcoin/protocol/handler.rb