3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-13 10:45:51 +00:00

Block.parseHeader() and Block.parseTransactions() are now protected, so they can be called from subclasses.

This commit is contained in:
Ross Nicoll 2015-05-26 00:02:20 +01:00 committed by Mike Hearn
parent e030f1a1f4
commit 4e8f1bb153

View File

@ -180,7 +180,7 @@ public class Block extends Message {
hash = null;
}
private void parseHeader() throws ProtocolException {
protected void parseHeader() throws ProtocolException {
if (headerParsed)
return;
@ -198,7 +198,7 @@ public class Block extends Message {
headerBytesValid = parseRetain;
}
private void parseTransactions() throws ProtocolException {
protected void parseTransactions() throws ProtocolException {
if (transactionsParsed)
return;
@ -561,6 +561,12 @@ public class Block extends Message {
public Block cloneAsHeader() {
maybeParseHeader();
Block block = new Block(params);
copyBitcoinHeaderTo(block);
return block;
}
/** Copy the block without transactions into the provided empty block. */
protected final void copyBitcoinHeaderTo(final Block block) {
block.nonce = nonce;
block.prevBlockHash = prevBlockHash;
block.merkleRoot = getMerkleRoot();
@ -569,7 +575,6 @@ public class Block extends Message {
block.difficultyTarget = difficultyTarget;
block.transactions = null;
block.hash = getHash();
return block;
}
/**