Fix persistHeader not returning proper header ID

This commit is contained in:
Edvard 2018-12-10 16:58:24 +01:00
parent 587d2219d8
commit 3cb8fe60d4

View File

@ -49,6 +49,7 @@ func persistHeader(db *postgres.DB, blockNumber int64, blockChain core.BlockChai
return core.Header{}, err
}
headerRepository := repositories.NewHeaderRepository(db)
_, err = headerRepository.CreateOrUpdateHeader(header)
id, err := headerRepository.CreateOrUpdateHeader(header)
header.Id = id
return header, err
}