{"action":"closed","issue":{"url":"https://api.github.com/repos/bitpay/bitcore-lib/issues/39","labels_url":"https://api.github.com/repos/bitpay/bitcore-lib/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/bitpay/bitcore-lib/issues/39/comments","events_url":"https://api.github.com/repos/bitpay/bitcore-lib/issues/39/events","html_url":"https://github.com/bitpay/bitcore-lib/issues/39","id":130309431,"number":39,"title":"Address.createMultiSig crashing bitcored","user":{"login":"chrisrico","id":3641429,"avatar_url":"https://avatars.githubusercontent.com/u/3641429?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisrico","html_url":"https://github.com/chrisrico","followers_url":"https://api.github.com/users/chrisrico/followers","following_url":"https://api.github.com/users/chrisrico/following{/other_user}","gists_url":"https://api.github.com/users/chrisrico/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisrico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisrico/subscriptions","organizations_url":"https://api.github.com/users/chrisrico/orgs","repos_url":"https://api.github.com/users/chrisrico/repos","events_url":"https://api.github.com/users/chrisrico/events{/privacy}","received_events_url":"https://api.github.com/users/chrisrico/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-02-01T09:36:22Z","updated_at":"2016-02-01T17:02:53Z","closed_at":"2016-02-01T17:02:53Z","body":"Stack trace (I'm not sure how to enable debug logging through bitcored):\r\n```\r\n[2016-02-01T09:26:42.984Z] error: uncaught exception: [TypeError: value is out of bounds]\r\n[2016-02-01T09:26:42.985Z] error: TypeError: value is out of bounds\r\n    at checkInt (buffer.js:832:11)\r\n    at Buffer.writeUInt8 (buffer.js:880:5)\r\n    at BufferWriter.writeUInt8 (/usr/local/lib/node_modules/bitcore/node_modules/bitcore-lib/lib/encoding/bufferwriter.js:42:7)\r\n    at Script.toBuffer (/usr/local/lib/node_modules/bitcore/node_modules/bitcore-lib/lib/script/script.js:115:8)\r\n    at Function.Address.payingTo (/usr/local/lib/node_modules/bitcore/node_modules/bitcore-lib/lib/address.js:338:61)\r\n    at Function.Address.createMultisig (/usr/local/lib/node_modules/bitcore/node_modules/bitcore-lib/lib/address.js:262:18)\r\n    at Function.Address._deriveAddress (/usr/local/lib/node_modules/bitcore/node_modules/bitcore-wallet-service/lib/model/address.js:56:40)\r\n    at Function.Address.derive (/usr/local/lib/node_modules/bitcore/node_modules/bitcore-wallet-service/lib/model/address.js:72:21)\r\n    at Wallet.createAddress (/usr/local/lib/node_modules/bitcore/node_modules/bitcore-wallet-service/lib/model/wallet.js:163:25)\r\n    at /usr/local/lib/node_modules/bitcore/node_modules/bitcore-wallet-service/lib/server.js:794:30\r\n```\r\n\r\nI logged the arguments to Address.payingTo:\r\n```\r\n{script: {\"chunks\":[{\"opcodenum\":811},{\"buf\":{\"type\":\"Buffer\",\"data\":[3,163,137,15,87,90,60,52,224,236,237,246,169,152,207,194,129,181,154,200,230,159,237,199,174,83,199,124,32,251,110,89,69]},\"len\":33,\"opcodenum\":33},{\"buf\":{\"type\":\"Buffer\",\"data\":[3,245,49,194,114,40,23,63,79,95,17,138,169,108,122,43,31,21,197,244,45,82,189,218,47,60,247,214,88,133,216,23,190]},\"len\":33,\"opcodenum\":33},{\"opcodenum\":82},{\"opcodenum\":174}]}, network: 'livenet'}\r\n```\r\n\r\nIt's ultimately failing on the call to bw.writeUInt8 with this chunk:\r\n```\r\n{ opcodenum: 811 }\r\n```"}}