pull/152/head
Rongjian Lan 6 years ago
parent c451155186
commit f89e4dce7b
  1. 3
      client/wallet/main.go
  2. 4
      node/node.go

@ -233,7 +233,8 @@ func SubmitTransaction(tx *types.Transaction, walletNode *node.Node) error {
func FetchBalance(address common.Address, walletNode *node.Node) map[uint32]AccountState {
result := make(map[uint32]AccountState)
for shardID, leader := range *walletNode.Client.Leaders {
client := client2.NewClient(leader.IP, node.ClientServicePort)
port, _ := strconv.Atoi(leader.Port)
client := client2.NewClient(leader.IP, strconv.Itoa(port+node.ClientServicePortDiff))
response := client.GetBalance(address)
balance := big.NewInt(0)
balance.SetBytes(response.Balance)

@ -486,8 +486,8 @@ func (node *Node) InitClientServer() {
// StartClientServer starts client server.
func (node *Node) StartClientServer() {
port, _ := strconv.Atoi(node.SelfPeer.Port)
node.log.Info("support_client: StartClientServer on port:", "port", port + ClientServicePortDiff)
node.clientServer.Start(node.SelfPeer.IP, strconv.Itoa(port + ClientServicePortDiff))
node.log.Info("support_client: StartClientServer on port:", "port", port+ClientServicePortDiff)
node.clientServer.Start(node.SelfPeer.IP, strconv.Itoa(port+ClientServicePortDiff))
}
// SupportSyncing keeps sleeping until it's doing consensus or it's a leader.

Loading…
Cancel
Save