|
|
@ -26,10 +26,12 @@ const ( |
|
|
|
lockPeriodInEpochs = 3 // This should be in sync with contracts/StakeLockContract.sol
|
|
|
|
lockPeriodInEpochs = 3 // This should be in sync with contracts/StakeLockContract.sol
|
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// UpdateStakingList updates staking information by querying the staking smart contract.
|
|
|
|
// UpdateStakingList updates staking list from the given StakeInfo query result.
|
|
|
|
func (node *Node) UpdateStakingList(stakeInfoReturnValue *structs.StakeInfoReturnValue) { |
|
|
|
func (node *Node) UpdateStakingList(stakeInfoReturnValue *structs.StakeInfoReturnValue) { |
|
|
|
|
|
|
|
if stakeInfoReturnValue == nil { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
node.CurrentStakes = make(map[common.Address]*structs.StakeInfo) |
|
|
|
node.CurrentStakes = make(map[common.Address]*structs.StakeInfo) |
|
|
|
if stakeInfoReturnValue != nil { |
|
|
|
|
|
|
|
for i, addr := range stakeInfoReturnValue.LockedAddresses { |
|
|
|
for i, addr := range stakeInfoReturnValue.LockedAddresses { |
|
|
|
blockNum := stakeInfoReturnValue.BlockNums[i] |
|
|
|
blockNum := stakeInfoReturnValue.BlockNums[i] |
|
|
|
lockPeriodCount := stakeInfoReturnValue.LockPeriodCounts[i] |
|
|
|
lockPeriodCount := stakeInfoReturnValue.LockPeriodCounts[i] |
|
|
@ -51,7 +53,6 @@ func (node *Node) UpdateStakingList(stakeInfoReturnValue *structs.StakeInfoRetur |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (node *Node) printStakingList() { |
|
|
|
func (node *Node) printStakingList() { |
|
|
|
utils.GetLogInstance().Info("\n") |
|
|
|
utils.GetLogInstance().Info("\n") |
|
|
|