Sha256: 2cc1c56c401dd0d7ad3bbe01271cd3395ccb0d49682d7dd9e09ce6afa5e10a50

Contents?: true

Size: 718 Bytes

Versions: 12

Compression:

Stored size: 718 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

      def on_error(message, payload)
        p ['error', message, payload]
      end

    end

  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
bitcoin-ruby-0.0.18 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.17 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.16 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.15 lib/bitcoin/protocol/handler.rb
monacoin-ruby-0.1.3 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.14 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.13 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.12 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.11 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.10 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.9 lib/bitcoin/protocol/handler.rb
bitcoin-ruby-0.0.8 lib/bitcoin/protocol/handler.rb