Skip to content

Commit 0f3c11d

Browse files
committed
suggestion by terence
1 parent e3d05bc commit 0f3c11d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

beacon-chain/state/state-native/getters_withdrawal.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err
121121
processedPartialWithdrawalsCount := uint64(0)
122122
var err error
123123
if b.version >= version.Electra {
124-
withdrawals, processedPartialWithdrawalsCount, err = b.processPendingPartialWithdrawals()
124+
withdrawals, processedPartialWithdrawalsCount, err = b.processPendingPartialWithdrawals(withdrawals)
125125
if err != nil {
126126
return nil, 0, err
127127
}
@@ -183,8 +183,7 @@ func withdrawalTotal(ws []*enginev1.Withdrawal, idx primitives.ValidatorIndex) (
183183
return
184184
}
185185

186-
func (b *BeaconState) processPendingPartialWithdrawals() ([]*enginev1.Withdrawal, uint64, error) {
187-
withdrawals := make([]*enginev1.Withdrawal, 0, params.BeaconConfig().MaxWithdrawalsPerPayload)
186+
func (b *BeaconState) processPendingPartialWithdrawals(withdrawals []*enginev1.Withdrawal) ([]*enginev1.Withdrawal, uint64, error) {
188187
withdrawalIndex := b.nextWithdrawalIndex
189188
epoch := slots.ToEpoch(b.slot)
190189
processedPartialWithdrawalsCount := uint64(0)

0 commit comments

Comments
 (0)