mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
send balance back to wallet
This commit is contained in:
parent
196a0a91a5
commit
fde20744f1
1 changed files with 6 additions and 2 deletions
|
|
@ -61,7 +61,7 @@ func handleRequest(conn net.Conn) {
|
||||||
|
|
||||||
go readerConn(conn, messages)
|
go readerConn(conn, messages)
|
||||||
go handleMessages(messages, checkBalanceChan)
|
go handleMessages(messages, checkBalanceChan)
|
||||||
go checkBalance(checkBalanceChan)
|
go checkBalance(checkBalanceChan, conn)
|
||||||
|
|
||||||
sendRingSignedMsg(conn)
|
sendRingSignedMsg(conn)
|
||||||
}
|
}
|
||||||
|
|
@ -141,10 +141,14 @@ func readerConn(conn net.Conn, channel chan []byte) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkBalance(checkBalanceChan chan []byte) {
|
func checkBalance(checkBalanceChan chan []byte, conn net.Conn) {
|
||||||
address := <-checkBalanceChan
|
address := <-checkBalanceChan
|
||||||
bal := getBalance(string(address[:]), client)
|
bal := getBalance(string(address[:]), client)
|
||||||
fmt.Println("The balance for address ", address, " is ", bal)
|
fmt.Println("The balance for address ", address, " is ", bal)
|
||||||
|
conn.Write([]byte("Broadcasting Balance"))
|
||||||
|
conn.Write([]byte("\n"))
|
||||||
|
conn.Write([]byte(bal))
|
||||||
|
conn.Write([]byte("\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendRingSignedMsg(conn net.Conn){
|
func sendRingSignedMsg(conn net.Conn){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue