@@ -28,19 +28,17 @@ import (
28
28
)
29
29
30
30
type ChainSync struct {
31
- oConn * ouroboros.Connection
32
- network string
33
- networkMagic uint32
34
- address string
35
- socketPath string
36
- ntcTcp bool
37
- intersectTip bool
38
- intersectPoints []ocommon.Point
39
- includeCbor bool
40
- errorChan chan error
41
- eventChan chan event.Event
42
- byronEpochBaseSlot uint64
43
- byronEpochSlot uint64
31
+ oConn * ouroboros.Connection
32
+ network string
33
+ networkMagic uint32
34
+ address string
35
+ socketPath string
36
+ ntcTcp bool
37
+ intersectTip bool
38
+ intersectPoints []ocommon.Point
39
+ includeCbor bool
40
+ errorChan chan error
41
+ eventChan chan event.Event
44
42
}
45
43
46
44
// New returns a new ChainSync object with the specified options applied
@@ -179,25 +177,8 @@ func (c *ChainSync) handleRollForward(blockType uint, blockData interface{}, tip
179
177
evt := event .New ("chainsync.block" , time .Now (), NewBlockEvent (v , c .includeCbor ))
180
178
c .eventChan <- evt
181
179
case ledger.BlockHeader :
182
- var blockSlot uint64
183
- var blockHash []byte
184
- switch blockType {
185
- case ledger .BLOCK_TYPE_BYRON_EBB :
186
- h := blockData .(* ledger.ByronEpochBoundaryBlockHeader )
187
- if c .byronEpochSlot > 0 {
188
- c .byronEpochBaseSlot += c .byronEpochSlot + 1
189
- }
190
- blockSlot = c .byronEpochBaseSlot
191
- blockHash , _ = hex .DecodeString (h .Hash ())
192
- case ledger .BLOCK_TYPE_BYRON_MAIN :
193
- h := blockData .(* ledger.ByronMainBlockHeader )
194
- c .byronEpochSlot = uint64 (h .ConsensusData .SlotId .Slot )
195
- blockSlot = c .byronEpochBaseSlot + c .byronEpochSlot
196
- blockHash , _ = hex .DecodeString (h .Hash ())
197
- default :
198
- blockSlot = v .SlotNumber ()
199
- blockHash , _ = hex .DecodeString (v .Hash ())
200
- }
180
+ blockSlot := v .SlotNumber ()
181
+ blockHash , _ := hex .DecodeString (v .Hash ())
201
182
block , err := c .oConn .BlockFetch ().Client .GetBlock (ocommon.Point {Slot : blockSlot , Hash : blockHash })
202
183
if err != nil {
203
184
return err
0 commit comments