mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-15 14:38:20 +00:00
6406afc6cf
* Native beacon state: v3 * nogo_config * remove duplicated bazel rule * gzl * fix unnecessary assignment * review Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
24 lines
670 B
Go
24 lines
670 B
Go
package v3
|
|
|
|
import (
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
// LatestExecutionPayloadHeader of the beacon state.
|
|
func (b *BeaconState) LatestExecutionPayloadHeader() (*ethpb.ExecutionPayloadHeader, error) {
|
|
if b.latestExecutionPayloadHeader == nil {
|
|
return nil, nil
|
|
}
|
|
|
|
b.lock.RLock()
|
|
defer b.lock.RUnlock()
|
|
|
|
return b.latestExecutionPayloadHeaderVal(), nil
|
|
}
|
|
|
|
// latestExecutionPayloadHeaderVal of the beacon state.
|
|
// This assumes that a lock is already held on BeaconState.
|
|
func (b *BeaconState) latestExecutionPayloadHeaderVal() *ethpb.ExecutionPayloadHeader {
|
|
return ethpb.CopyExecutionPayloadHeader(b.latestExecutionPayloadHeader)
|
|
}
|