[NOD-368] correct text output of address generator (#433)

* [NOD-368] correct text output of address generator (address instead of public key)

* [NOD-368] add hash160 to output of genaddr

* [NOD-368] change encoding to hexadecimal

* [NOD-368] fix formatting
This commit is contained in:
Dan Aharoni 2019-10-24 18:00:06 +03:00 committed by stasatdaglabs
parent 3018c18616
commit 92578e2853

View File

@ -1,6 +1,7 @@
package main
import (
"encoding/hex"
"fmt"
"os"
@ -28,5 +29,7 @@ func main() {
fmt.Fprintf(os.Stderr, "Failed to generate p2pkh address: %s", err)
os.Exit(1)
}
fmt.Printf("Public key: %s\n\n", addr)
fmt.Printf("Address: %s\n", addr)
hash160 := addr.Hash160()[:]
fmt.Printf("Hash160 of address (hex): %s\n\n", hex.EncodeToString(hash160))
}