From 92578e2853fcad864e1cd022da9e54a766f586c5 Mon Sep 17 00:00:00 2001 From: Dan Aharoni Date: Thu, 24 Oct 2019 18:00:06 +0300 Subject: [PATCH] [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 --- cmd/genaddr/genaddr.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/genaddr/genaddr.go b/cmd/genaddr/genaddr.go index 791cc011b..baa0b90c7 100644 --- a/cmd/genaddr/genaddr.go +++ b/cmd/genaddr/genaddr.go @@ -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)) }