mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +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:
@@ -204,7 +204,6 @@ public class AltcoinBlock extends org.bitcoinj.core.Block {
|
|||||||
if (auxpowParams.isAuxPoWBlockVersion(this.getRawVersion())
|
if (auxpowParams.isAuxPoWBlockVersion(this.getRawVersion())
|
||||||
&& 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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,6 +217,7 @@ public class AltcoinBlock extends org.bitcoinj.core.Block {
|
|||||||
parseAuxPoW();
|
parseAuxPoW();
|
||||||
if (null != this.auxpow) {
|
if (null != this.auxpow) {
|
||||||
super.parseTransactions(offset + auxpow.getMessageSize());
|
super.parseTransactions(offset + auxpow.getMessageSize());
|
||||||
|
optimalEncodingMessageSize += auxpow.getMessageSize();
|
||||||
} else {
|
} else {
|
||||||
super.parseTransactions(offset);
|
super.parseTransactions(offset);
|
||||||
}
|
}
|
||||||
|
@@ -141,8 +141,6 @@ public class AuxPoW extends ChildMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getOptimalEncodingMessageSize() {
|
public int getOptimalEncodingMessageSize() {
|
||||||
if (optimalEncodingMessageSize != 0)
|
|
||||||
return optimalEncodingMessageSize;
|
|
||||||
if (optimalEncodingMessageSize != 0)
|
if (optimalEncodingMessageSize != 0)
|
||||||
return optimalEncodingMessageSize;
|
return optimalEncodingMessageSize;
|
||||||
optimalEncodingMessageSize = getMessageSize();
|
optimalEncodingMessageSize = getMessageSize();
|
||||||
|
Reference in New Issue
Block a user