bitpay / bitcore-p2p

Interface to the bitcoin P2P network for bitcore
MIT License
80 stars 276 forks source link

Add a method on Messages to extend messages commands. #71

Closed braydonf closed 9 years ago

braydonf commented 9 years ago

Example usage:

var p2p = require('bitcore-p2p');
var Message = p2p.Message;
function CustomMessage(arg, options) {
  Message.call(this, options);
  ...
}
inherits(CustomMessage, Message);

var messages = new Messages();
messages.extend('command', 'MessageName', CustomMessage);
braydonf commented 9 years ago

Included in: https://github.com/bitpay/bitcore-p2p/commit/d4958eb05fd02f0a597e18ad5ca56b4a051638c6