Skip to content
Snippets Groups Projects
Commit b6a1f902 authored by Miguel Montes's avatar Miguel Montes
Browse files

Corrección de error de tipos en PeerCount

parent c0f27af4
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"math/big" "math/big"
"sort" "sort"
"strconv"
) )
type Node rpc.Client type Node rpc.Client
...@@ -80,9 +81,11 @@ func (node *Node) IsMining() (mining bool) { ...@@ -80,9 +81,11 @@ func (node *Node) IsMining() (mining bool) {
return return
} }
func (node *Node) PeerCount() (peerCount int64) { func (node *Node) PeerCount() int64 {
var peerCount string
node.Call(&peerCount, "net_peerCount") node.Call(&peerCount, "net_peerCount")
return p, _ := strconv.ParseInt(peerCount, 0, 64)
return p
} }
func (node *Node) BalanceAtBlock(account string, blockNumber int64) *big.Int { func (node *Node) BalanceAtBlock(account string, blockNumber int64) *big.Int {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment