From e34a18169a5e3435b340df568cc4837ad27fd18e Mon Sep 17 00:00:00 2001 From: Alexander Chepurnoy Date: Mon, 13 Jan 2025 22:57:19 +0300 Subject: [PATCH] comments for extension fields --- .../ergoplatform/mining/CandidateGenerator.scala | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/scala/org/ergoplatform/mining/CandidateGenerator.scala b/src/main/scala/org/ergoplatform/mining/CandidateGenerator.scala index fa18a828bd..cc66c35110 100644 --- a/src/main/scala/org/ergoplatform/mining/CandidateGenerator.scala +++ b/src/main/scala/org/ergoplatform/mining/CandidateGenerator.scala @@ -519,13 +519,19 @@ object CandidateGenerator extends ScorexLogging { (interlinksExtension, Array(0: Byte, 0: Byte, 0: Byte), Header.InitialVersion) ) - val inputBlockTransactionsDigest = parentInputBlockIdOpt.map { prevInputBlockId => - (InputBlockTransactionsDigestKey, prevInputBlockId) + // digest (Merkle tree root) of new first-class transactions since last input-block + val inputBlockTransactionsDigest = (InputBlockTransactionsDigestKey, Array.emptyByteArray) // todo: real bytes + + // digest (Merkle tree root) of new first-class transactions since last input-block + val previousInputBlocksTransactions = (PreviousInputBlockTransactionsDigestKey, Array.emptyByteArray) // todo: real bytes + + // reference to a last seen input block + val prevInputBlockId = parentInputBlockIdOpt.map { prevInputBlockId => + (PrevInputBlockIdKey, prevInputBlockId) }.toSeq - val previousInputBlockTransactions = (PreviousInputBlockTransactionsDigestKey, Array.emptyByteArray) // todo: real bytes - val prevInputBlockId = (PrevInputBlockIdKey, Array.emptyByteArray) // todo: real bytes + val inputBlockFields = ExtensionCandidate( - inputBlockTransactionsDigest ++ Seq(previousInputBlockTransactions, prevInputBlockId) + prevInputBlockId ++ Seq(inputBlockTransactionsDigest, previousInputBlocksTransactions) ) val extensionCandidate = preExtensionCandidate ++ inputBlockFields