3
0
mirror of https://github.com/Qortal/qortal.git synced 2025-02-12 18:25:49 +00:00

Add static method to extract generatorSignature from block reference

This commit is contained in:
catbref 2019-05-16 13:12:35 +01:00
parent ce2dc9b8ad
commit c05fe58676

View File

@ -277,8 +277,12 @@ public class BlockTransformer extends Transformer {
}
}
public static byte[] getReferenceGeneratorSignature(byte[] blockReference) {
return Arrays.copyOf(blockReference, GENERATOR_SIGNATURE_LENGTH);
}
public static byte[] getBytesForGeneratorSignature(BlockData blockData) throws TransformationException {
byte[] generatorSignature = Arrays.copyOf(blockData.getReference(), GENERATOR_SIGNATURE_LENGTH);
byte[] generatorSignature = getReferenceGeneratorSignature(blockData.getReference());
PublicKeyAccount generator = new PublicKeyAccount(null, blockData.getGeneratorPublicKey());
return getBytesForGeneratorSignature(generatorSignature, blockData.getGeneratingBalance(), generator);