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:
parent
e030f1a1f4
commit
4e8f1bb153
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user