Rename utility function IntToHex to IntToBytes
This commit is contained in:
parent
ff408351a2
commit
0ef853d139
|
@ -35,9 +35,9 @@ func (pow *ProofOfWork) prepareData(nonce int) []byte {
|
||||||
[][]byte{
|
[][]byte{
|
||||||
pow.block.PrevBlockHash,
|
pow.block.PrevBlockHash,
|
||||||
pow.block.HashTransactions(),
|
pow.block.HashTransactions(),
|
||||||
IntToHex(pow.block.Timestamp),
|
IntToBytes(pow.block.Timestamp),
|
||||||
IntToHex(int64(targetBits)),
|
IntToBytes(int64(targetBits)),
|
||||||
IntToHex(int64(nonce)),
|
IntToBytes(int64(nonce)),
|
||||||
},
|
},
|
||||||
[]byte{},
|
[]byte{},
|
||||||
)
|
)
|
||||||
|
|
2
utils.go
2
utils.go
|
@ -7,7 +7,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// IntToHex converts an int64 to a byte array
|
// IntToHex converts an int64 to a byte array
|
||||||
func IntToHex(num int64) []byte {
|
func IntToBytes(num int64) []byte {
|
||||||
buff := new(bytes.Buffer)
|
buff := new(bytes.Buffer)
|
||||||
err := binary.Write(buff, binary.BigEndian, num)
|
err := binary.Write(buff, binary.BigEndian, num)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue