File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
process/elasticproc/block Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ func (bp *blockProcessor) PrepareBlockForDB(obh *outport.OutportBlockWithHeader)
9090 Hash : hex .EncodeToString (obh .BlockData .HeaderHash ),
9191 MiniBlocksHashes : miniblocksHashes ,
9292 NotarizedBlocksHashes : obh .NotarizedHeadersHashes ,
93- Proposer : obh . LeaderIndex ,
93+ Proposer : getLeaderIndex ( obh ) ,
9494 ProposerBlsKey : hex .EncodeToString (obh .LeaderBLSKey ),
9595 Validators : obh .SignersIndexes ,
9696 PubKeyBitmap : hex .EncodeToString (obh .Header .GetPubKeysBitmap ()),
@@ -142,6 +142,18 @@ func (bp *blockProcessor) PrepareBlockForDB(obh *outport.OutportBlockWithHeader)
142142 return elasticBlock , nil
143143}
144144
145+ func getLeaderIndex (obh * outport.OutportBlockWithHeader ) uint64 {
146+ if obh .BlockData .HeaderProof != nil {
147+ return obh .LeaderIndex
148+ }
149+
150+ if len (obh .SignersIndexes ) > 0 {
151+ return obh .SignersIndexes [0 ]
152+ }
153+
154+ return 0
155+ }
156+
145157func addProofs (elasticBlock * data.Block , obh * outport.OutportBlockWithHeader ) {
146158 if obh .BlockData .HeaderProof != nil {
147159 elasticBlock .Proof = proofToAPIProof (obh .BlockData .HeaderProof )
You can’t perform that action at this time.
0 commit comments