3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-11 17:55:53 +00:00

Advance the cursor the full header length

Otherweise parsing the nonexistant transactions would reset the size of the message to 80
This commit is contained in:
langerhans 2015-10-24 21:58:48 +02:00 committed by Ross Nicoll
parent 1dcdff9f6e
commit 2c3466866c
2 changed files with 1 additions and 3 deletions

View File

@ -204,7 +204,6 @@ public class AltcoinBlock extends org.bitcoinj.core.Block {
if (auxpowParams.isAuxPoWBlockVersion(this.getRawVersion())
&& 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);
optimalEncodingMessageSize += auxpow.getOptimalEncodingMessageSize();
}
}
@ -218,6 +217,7 @@ public class AltcoinBlock extends org.bitcoinj.core.Block {
parseAuxPoW();
if (null != this.auxpow) {
super.parseTransactions(offset + auxpow.getMessageSize());
optimalEncodingMessageSize += auxpow.getMessageSize();
} else {
super.parseTransactions(offset);
}

View File

@ -141,8 +141,6 @@ public class AuxPoW extends ChildMessage {
}
public int getOptimalEncodingMessageSize() {
if (optimalEncodingMessageSize != 0)
return optimalEncodingMessageSize;
if (optimalEncodingMessageSize != 0)
return optimalEncodingMessageSize;
optimalEncodingMessageSize = getMessageSize();