start checking for height coinbases earlier.
This commit is contained in:
parent
58d8e3ce53
commit
fdc11b76b2
@ -1174,19 +1174,25 @@ script.coinbaseBits = function coinbaseBits(s, block) {
|
||||
|
||||
value = new bn(s[0].reverse()).toNumber();
|
||||
|
||||
// Test for bits and ts
|
||||
if (block) {
|
||||
if (value === block.bits)
|
||||
return { type: 'bits', value: value };
|
||||
|
||||
if (value === block.ts)
|
||||
return { type: 'ts', value: value };
|
||||
}
|
||||
|
||||
// Test for height
|
||||
if (block) {
|
||||
if (block.version < 2)
|
||||
return { type: 'value', value: value };
|
||||
} else {
|
||||
if (value <= 227835)
|
||||
return { type: 'value', value: value };
|
||||
}
|
||||
|
||||
// Last v1 block
|
||||
if (s[0].length < 3 || value < 227835)
|
||||
if (s[0].length < 3)
|
||||
return { type: 'value', value: value };
|
||||
|
||||
return { type: 'height', value: value };
|
||||
|
||||
Loading…
Reference in New Issue
Block a user