mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-29 08:28:50 +00:00
[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:
parent
3018c18616
commit
92578e2853
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
@ -28,5 +29,7 @@ func main() {
|
|||||||
fmt.Fprintf(os.Stderr, "Failed to generate p2pkh address: %s", err)
|
fmt.Fprintf(os.Stderr, "Failed to generate p2pkh address: %s", err)
|
||||||
os.Exit(1)
|
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))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user