|
|
@ -1,16 +1,15 @@ |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
var _ = require('lodash'); |
|
|
|
var bu = require('./util/buffer'); |
|
|
|
|
|
|
|
var Address = require('./address'); |
|
|
|
var BufferReader = require('./encoding/bufferreader'); |
|
|
|
var BufferWriter = require('./encoding/bufferwriter'); |
|
|
|
var Errors = require('./errors'); |
|
|
|
var Hash = require('./crypto/hash'); |
|
|
|
var Opcode = require('./opcode'); |
|
|
|
var PublicKey = require('./publickey'); |
|
|
|
var PublicKey = require('./publickey'); |
|
|
|
var Hash = require('./crypto/hash'); |
|
|
|
var bu = require('./util/buffer'); |
|
|
|
var _ = require('lodash'); |
|
|
|
|
|
|
|
/** |
|
|
|
* A bitcoin transaction script. Each transaction's inputs and outputs |
|
|
@ -304,6 +303,17 @@ Script.prototype.isDataOut = function() { |
|
|
|
this.chunks[1].length === this.chunks.len))); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
* @returns true if the script is only composed of data pushing |
|
|
|
* opcodes or small int opcodes (OP_0, OP_1, ..., OP_16) |
|
|
|
*/ |
|
|
|
Script.prototype.isPushOnly = function() { |
|
|
|
return _.every(this.chunks, function(chunk) { |
|
|
|
var opcodenum = chunk.opcodenum; |
|
|
|
return !_.isUndefined(opcodenum) || chunk <= Opcode.map.OP_16; |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Script.types = {}; |
|
|
|
Script.types.UNKNOWN = 'Unknown'; |
|
|
|