@@ -8,40 +8,6 @@ var curve = ecurve.getCurveByName('secp256k1')
88var ECSignature = require ( './ecsignature' )
99var Script = require ( './script' )
1010
11- function classifyOutput ( script ) {
12- enforceType ( Script , script )
13-
14- if ( isPubKeyHashOutput . call ( script ) ) {
15- return 'pubkeyhash'
16- } else if ( isScriptHashOutput . call ( script ) ) {
17- return 'scripthash'
18- } else if ( isMultisigOutput . call ( script ) ) {
19- return 'multisig'
20- } else if ( isPubKeyOutput . call ( script ) ) {
21- return 'pubkey'
22- } else if ( isNulldataOutput . call ( script ) ) {
23- return 'nulldata'
24- } else {
25- return 'nonstandard'
26- }
27- }
28-
29- function classifyInput ( script ) {
30- enforceType ( Script , script )
31-
32- if ( isPubKeyHashInput . call ( script ) ) {
33- return 'pubkeyhash'
34- } else if ( isScriptHashInput . call ( script ) ) {
35- return 'scripthash'
36- } else if ( isMultisigInput . call ( script ) ) {
37- return 'multisig'
38- } else if ( isPubKeyInput . call ( script ) ) {
39- return 'pubkey'
40- } else {
41- return 'nonstandard'
42- }
43- }
44-
4511function isCanonicalPubKey ( buffer ) {
4612 if ( ! Buffer . isBuffer ( buffer ) ) return false
4713
@@ -150,6 +116,40 @@ function isNulldataOutput() {
150116 return this . chunks [ 0 ] === ops . OP_RETURN
151117}
152118
119+ function classifyOutput ( script ) {
120+ enforceType ( Script , script )
121+
122+ if ( isPubKeyHashOutput . call ( script ) ) {
123+ return 'pubkeyhash'
124+ } else if ( isScriptHashOutput . call ( script ) ) {
125+ return 'scripthash'
126+ } else if ( isMultisigOutput . call ( script ) ) {
127+ return 'multisig'
128+ } else if ( isPubKeyOutput . call ( script ) ) {
129+ return 'pubkey'
130+ } else if ( isNulldataOutput . call ( script ) ) {
131+ return 'nulldata'
132+ } else {
133+ return 'nonstandard'
134+ }
135+ }
136+
137+ function classifyInput ( script ) {
138+ enforceType ( Script , script )
139+
140+ if ( isPubKeyHashInput . call ( script ) ) {
141+ return 'pubkeyhash'
142+ } else if ( isScriptHashInput . call ( script ) ) {
143+ return 'scripthash'
144+ } else if ( isMultisigInput . call ( script ) ) {
145+ return 'multisig'
146+ } else if ( isPubKeyInput . call ( script ) ) {
147+ return 'pubkey'
148+ } else {
149+ return 'nonstandard'
150+ }
151+ }
152+
153153// Standard Script Templates
154154// {pubKey} OP_CHECKSIG
155155function pubKeyOutput ( pubKey ) {
0 commit comments