Use block value correctly when proposing a block (#13368)

* Use block value correctly

* Fix the function
This commit is contained in:
terence 2023-12-21 11:00:34 +08:00 committed by GitHub
parent 856907d760
commit a068f3877e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -347,12 +347,16 @@ func (b *SignedBeaconBlock) IsBlinded() bool {
func (b *SignedBeaconBlock) ValueInGwei() uint64 { func (b *SignedBeaconBlock) ValueInGwei() uint64 {
exec, err := b.block.body.Execution() exec, err := b.block.body.Execution()
if err != nil { if err != nil {
log.WithError(err).Warn("failed to retrieve execution payload") if !errors.Is(err, consensus_types.ErrUnsupportedField) {
log.WithError(err).Warn("failed to retrieve execution payload")
}
return 0 return 0
} }
val, err := exec.ValueInGwei() val, err := exec.ValueInGwei()
if err != nil { if err != nil {
log.WithError(err).Warn("failed to retrieve value in gwei") if !errors.Is(err, consensus_types.ErrUnsupportedField) {
log.WithError(err).Warn("failed to retrieve execution payload")
}
return 0 return 0
} }
return val return val