Skip to content

Commit

Permalink
comments for extension fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Jan 13, 2025
1 parent 7dcec20 commit e34a181
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/scala/org/ergoplatform/mining/CandidateGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e34a181

Please sign in to comment.