Abort QueryStakeInfo on early errors

pull/625/head
Eugene Kim 6 years ago
parent d08bcc150c
commit 12d5e9f669
  1. 2
      node/contract.go

@ -61,10 +61,12 @@ func (node *Node) QueryStakeInfo() *structs.StakeInfoReturnValue {
abi, err := abi.JSON(strings.NewReader(contracts.StakeLockContractABI)) abi, err := abi.JSON(strings.NewReader(contracts.StakeLockContractABI))
if err != nil { if err != nil {
utils.GetLogInstance().Error("Failed to generate staking contract's ABI", "error", err) utils.GetLogInstance().Error("Failed to generate staking contract's ABI", "error", err)
return nil
} }
bytesData, err := abi.Pack("listLockedAddresses") bytesData, err := abi.Pack("listLockedAddresses")
if err != nil { if err != nil {
utils.GetLogInstance().Error("Failed to generate ABI function bytes data", "error", err) utils.GetLogInstance().Error("Failed to generate ABI function bytes data", "error", err)
return nil
} }
priKey := contract_constants.GenesisBeaconAccountPriKey priKey := contract_constants.GenesisBeaconAccountPriKey

Loading…
Cancel
Save