Rename utility function IntToHex to IntToBytes

This commit is contained in:
stasvo 2021-11-25 11:58:28 +03:00
parent ff408351a2
commit 0ef853d139
2 changed files with 4 additions and 4 deletions

View File

@ -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{},
) )

View File

@ -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 {