lib/inventory.js
function Inventory(obj) {
  this.type = obj.type;
  if (!BufferUtil.isBuffer(obj.hash)) {
    throw new TypeError('Unexpected hash, expected to be a buffer');
  }
  this.hash = obj.hash;
}
function Inventory(obj) {
  this.type = obj.type;
  if (!BufferUtil.isBuffer(obj.hash)) {
    throw new TypeError('Unexpected hash, expected to be a buffer');
  }
  this.hash = obj.hash;
}
function Inventory ( obj ) { this . type = obj . type ; if ( ! BufferUtil . isBuffer ( obj . hash ) ) { throw new TypeError ( 'Unexpected hash, expected to be a buffer' ) ; } this . hash = obj . hash ; }
A constructor for inventory related Bitcoin messages such as
"getdata", "inv" and "notfound".
@param {Object} obj
@param {Number} obj.type - Inventory.TYPE
@param {Buffer} obj.hash - The hash for the inventory
@constructor
A constructor for inventory related Bitcoin messages such as getdata inv and notfound .