Changes existing code to use new base58 API

This commit is contained in:
Daniel Cousens 2014-04-04 05:10:12 +11:00
parent f53b821cc9
commit 6fa0c07763
7 changed files with 83 additions and 52 deletions

View file

@ -279,6 +279,11 @@ Script.prototype.writeOp = function(opcode) {
* Add a data chunk to the script.
*/
Script.prototype.writeBytes = function(data) {
// FIXME: Script module doesn't support buffers yet
if (Buffer.isBuffer(data)) {
data = Array.prototype.map.bind(data, function(x) { return x })()
}
if (data.length < Opcode.map.OP_PUSHDATA1) {
this.buffer.push(data.length)
} else if (data.length <= 0xff) {