Skip parsing AuxPoW block header where the header is too short (i.e. checkpoint blocks)

This commit is contained in:
Ross Nicoll
2015-10-16 18:59:54 +01:00
parent 8a96492c80
commit 0fe4ac43ba

View File

@@ -196,9 +196,8 @@ public class AltcoinBlock extends org.bitcoinj.core.Block {
this.auxpow = null; this.auxpow = null;
if (this.auxpowChain) { if (this.auxpowChain) {
final AuxPoWNetworkParameters auxpowParams = (AuxPoWNetworkParameters)this.params; final AuxPoWNetworkParameters auxpowParams = (AuxPoWNetworkParameters)this.params;
if (auxpowParams.isAuxPoWBlockVersion(this.getRawVersion())) { if (auxpowParams.isAuxPoWBlockVersion(this.getRawVersion())
// The following is used in dogecoinj, but I don't think we necessarily need it && payload.length >= 160) { // We have at least 2 headers in an Aux block. Workaround for StoredBlocks
// payload.length >= 160) { // We have at least 2 headers in an Aux block. Workaround for StoredBlocks
this.auxpow = new AuxPoW(params, payload, cursor, this, serializer); this.auxpow = new AuxPoW(params, payload, cursor, this, serializer);
optimalEncodingMessageSize += auxpow.getOptimalEncodingMessageSize(); optimalEncodingMessageSize += auxpow.getOptimalEncodingMessageSize();
} }