Skip to content

Commit

Permalink
fix: string casting in DumpHistory & FetchBlock (#260)
Browse files Browse the repository at this point in the history
Signed-off-by: Ales Verbic <verbotenj@blinklabs.io>
  • Loading branch information
verbotenj authored Sep 29, 2024
1 parent 4ae6a1d commit b82e8ed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/utxorpc/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ func (s *chainSyncServiceServer) FetchBlock(
for _, blockRef := range ref {
blockIdx := blockRef.GetIndex()
blockHash := blockRef.GetHash()
hash, _ := hex.DecodeString(string(blockHash))
slot := uint64(blockIdx)
point := ocommon.NewPoint(slot, hash)
point := ocommon.NewPoint(slot, blockHash)
points = append(points, point)
}
} else {
Expand Down Expand Up @@ -133,9 +132,8 @@ func (s *chainSyncServiceServer) DumpHistory(
blockRef := startToken
blockIdx := blockRef.GetIndex()
blockHash := blockRef.GetHash()
hash, _ := hex.DecodeString(string(blockHash))
slot := uint64(blockIdx)
startPoint = ocommon.NewPoint(slot, hash)
startPoint = ocommon.NewPoint(slot, blockHash)
} else {
log.Printf("getting tip\n")
tip, err := oConn.ChainSync().Client.GetCurrentTip()
Expand Down

0 comments on commit b82e8ed

Please sign in to comment.