mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-10 22:36:01 +00:00
parent
5e3e4b1706
commit
af52edaef7
@ -19,10 +19,21 @@ proc addMapping*(store: var DynamicFeeRecipientsStore,
|
||||
validator: ValidatorIndex,
|
||||
feeRecipient: Eth1Address,
|
||||
currentEpoch: Epoch) =
|
||||
info "Updating fee recipient",
|
||||
validator, feeRecipient = feeRecipient.toHex(), currentEpoch
|
||||
store.mappings[validator] = Entry(recipient: feeRecipient,
|
||||
addedAt: currentEpoch)
|
||||
var
|
||||
found, updated = false
|
||||
store.mappings.withValue(validator, entry) do:
|
||||
updated = not (entry[].recipient == feeRecipient)
|
||||
entry[] = Entry(recipient: feeRecipient, addedAt: currentEpoch)
|
||||
do:
|
||||
updated = true
|
||||
store.mappings[validator] = Entry(recipient: feeRecipient,
|
||||
addedAt: currentEpoch)
|
||||
if updated:
|
||||
info "Updating fee recipient",
|
||||
validator, feeRecipient = feeRecipient.toHex(), currentEpoch
|
||||
else:
|
||||
debug "Refreshing fee recipient",
|
||||
validator, feeRecipient = feeRecipient.toHex(), currentEpoch
|
||||
|
||||
func getDynamicFeeRecipient*(store: var DynamicFeeRecipientsStore,
|
||||
validator: ValidatorIndex,
|
||||
|
@ -17,7 +17,7 @@ import
|
||||
|
||||
export constants
|
||||
|
||||
export stint, ethtypes.toHex
|
||||
export stint, ethtypes.toHex, ethtypes.`==`
|
||||
|
||||
const
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/phase0/beacon-chain.md#withdrawal-prefixes
|
||||
|
Loading…
x
Reference in New Issue
Block a user