fix coinbase height.
This commit is contained in:
parent
f4c991ab77
commit
ec5c548fe1
@ -2891,9 +2891,18 @@ Script.prototype.getCoinbaseHeight = function getCoinbaseHeight() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Script.getCoinbaseHeight = function getCoinbaseHeight(code) {
|
Script.getCoinbaseHeight = function getCoinbaseHeight(code) {
|
||||||
|
var height;
|
||||||
|
|
||||||
if (code.length === 0)
|
if (code.length === 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (typeof code[0] === 'number') {
|
||||||
|
height = Script.getSmall(code[0]);
|
||||||
|
if (height == null)
|
||||||
|
return -1;
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Buffer.isBuffer(code[0]))
|
if (!Buffer.isBuffer(code[0]))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user