Add range check on height extracted from coinbase script
This commit is contained in:
committed by
George Tankersley
parent
bb62739502
commit
722118ade9
@@ -70,6 +70,9 @@ func (b *block) GetHeight() int {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
// uint32 should last us a while (Nov 2018)
|
// uint32 should last us a while (Nov 2018)
|
||||||
|
if heightNum > int64(^uint32(0)) {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
blockHeight := uint32(heightNum)
|
blockHeight := uint32(heightNum)
|
||||||
|
|
||||||
if blockHeight == genesisTargetDifficulty {
|
if blockHeight == genesisTargetDifficulty {
|
||||||
|
|||||||
Reference in New Issue
Block a user