chaintope / bitcoinrb

The implementation of the bitcoin protocol for ruby.
MIT License
61 stars 19 forks source link

Add listener for tx message and headers message. #20

Closed Yamaguchi closed 6 years ago

Yamaguchi commented 6 years ago

This PR allows bitcoinrb to notify that it receives tx message and headers message.

Yamaguchi commented 6 years ago

To use observer, must implement #update(event, data) method.


class Watcher 
  def update(event, data)
    case event
    when :tx
      # TODO :
    when :header
      # TODO :
    end  
  end
end

watcher = Wather.new
spv.add_observer(watcher)