Fix nil dereference on merge mining tag depth
This commit is contained in:
parent
68abe04340
commit
4a8971dae1
|
@ -240,7 +240,7 @@ func NewShareFromExportedBytes(buf []byte, consensus *Consensus, cacheInterface
|
||||||
b.CachedShareVersion = b.CalculateShareVersion(consensus)
|
b.CachedShareVersion = b.CalculateShareVersion(consensus)
|
||||||
|
|
||||||
//TODO: this is to comply with non-standard p2pool serialization, see https://github.com/SChernykh/p2pool/issues/249
|
//TODO: this is to comply with non-standard p2pool serialization, see https://github.com/SChernykh/p2pool/issues/249
|
||||||
if t := b.Main.Coinbase.Extra.GetTag(transaction.TxExtraTagMergeMining); t == nil && t.VarInt != 32 {
|
if t := b.Main.Coinbase.Extra.GetTag(transaction.TxExtraTagMergeMining); t == nil || t.VarInt != 32 {
|
||||||
return nil, errors.New("wrong merge mining tag depth")
|
return nil, errors.New("wrong merge mining tag depth")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ func (b *PoolBlock) FromReader(consensus *Consensus, derivationCache DerivationC
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: this is to comply with non-standard p2pool serialization, see https://github.com/SChernykh/p2pool/issues/249
|
//TODO: this is to comply with non-standard p2pool serialization, see https://github.com/SChernykh/p2pool/issues/249
|
||||||
if t := b.Main.Coinbase.Extra.GetTag(transaction.TxExtraTagMergeMining); t == nil && t.VarInt != 32 {
|
if t := b.Main.Coinbase.Extra.GetTag(transaction.TxExtraTagMergeMining); t == nil || t.VarInt != 32 {
|
||||||
return errors.New("wrong merge mining tag depth")
|
return errors.New("wrong merge mining tag depth")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,7 +533,7 @@ func (b *PoolBlock) FromCompactReader(consensus *Consensus, derivationCache Deri
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: this is to comply with non-standard p2pool serialization, see https://github.com/SChernykh/p2pool/issues/249
|
//TODO: this is to comply with non-standard p2pool serialization, see https://github.com/SChernykh/p2pool/issues/249
|
||||||
if t := b.Main.Coinbase.Extra.GetTag(transaction.TxExtraTagMergeMining); t == nil && t.VarInt != 32 {
|
if t := b.Main.Coinbase.Extra.GetTag(transaction.TxExtraTagMergeMining); t == nil || t.VarInt != 32 {
|
||||||
return errors.New("wrong merge mining tag depth")
|
return errors.New("wrong merge mining tag depth")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue