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:
parent
1dcdff9f6e
commit
2c3466866c
@ -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);
|
||||
}
|
||||
|
@ -141,8 +141,6 @@ public class AuxPoW extends ChildMessage {
|
||||
}
|
||||
|
||||
public int getOptimalEncodingMessageSize() {
|
||||
if (optimalEncodingMessageSize != 0)
|
||||
return optimalEncodingMessageSize;
|
||||
if (optimalEncodingMessageSize != 0)
|
||||
return optimalEncodingMessageSize;
|
||||
optimalEncodingMessageSize = getMessageSize();
|
||||
|
Loading…
x
Reference in New Issue
Block a user