|
|
@ -395,7 +395,7 @@ func (api *ConsensusAPI) ExchangeTransitionConfigurationV1(config engine.Transit |
|
|
|
|
|
|
|
|
|
|
|
// GetPayloadV1 returns a cached payload by id.
|
|
|
|
// GetPayloadV1 returns a cached payload by id.
|
|
|
|
func (api *ConsensusAPI) GetPayloadV1(payloadID engine.PayloadID) (*engine.ExecutableData, error) { |
|
|
|
func (api *ConsensusAPI) GetPayloadV1(payloadID engine.PayloadID) (*engine.ExecutableData, error) { |
|
|
|
data, err := api.getPayload(payloadID) |
|
|
|
data, err := api.getPayload(payloadID, false) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -404,17 +404,17 @@ func (api *ConsensusAPI) GetPayloadV1(payloadID engine.PayloadID) (*engine.Execu |
|
|
|
|
|
|
|
|
|
|
|
// GetPayloadV2 returns a cached payload by id.
|
|
|
|
// GetPayloadV2 returns a cached payload by id.
|
|
|
|
func (api *ConsensusAPI) GetPayloadV2(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error) { |
|
|
|
func (api *ConsensusAPI) GetPayloadV2(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error) { |
|
|
|
return api.getPayload(payloadID) |
|
|
|
return api.getPayload(payloadID, false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetPayloadV3 returns a cached payload by id.
|
|
|
|
// GetPayloadV3 returns a cached payload by id.
|
|
|
|
func (api *ConsensusAPI) GetPayloadV3(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error) { |
|
|
|
func (api *ConsensusAPI) GetPayloadV3(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error) { |
|
|
|
return api.getPayload(payloadID) |
|
|
|
return api.getPayload(payloadID, false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (api *ConsensusAPI) getPayload(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error) { |
|
|
|
func (api *ConsensusAPI) getPayload(payloadID engine.PayloadID, full bool) (*engine.ExecutionPayloadEnvelope, error) { |
|
|
|
log.Trace("Engine API request received", "method", "GetPayload", "id", payloadID) |
|
|
|
log.Trace("Engine API request received", "method", "GetPayload", "id", payloadID) |
|
|
|
data := api.localBlocks.get(payloadID, true) |
|
|
|
data := api.localBlocks.get(payloadID, full) |
|
|
|
if data == nil { |
|
|
|
if data == nil { |
|
|
|
return nil, engine.UnknownPayload |
|
|
|
return nil, engine.UnknownPayload |
|
|
|
} |
|
|
|
} |
|
|
|