Skip to content

Commit

Permalink
fix: Duplicate memory allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
humblenginr committed Apr 10, 2024
1 parent c44d1a3 commit dc345fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mining/mining.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ func MineBlock(candidateBlock Block, outputFilePath string) error {

func findNonce(candidateBlock *Block) uint32 {
// serialized block will be of 80 byte
w := bytes.NewBuffer(make([]byte, 0, 80))
for {
w := bytes.NewBuffer(make([]byte, 0, 84))
header := candidateBlock.BlockHeader
nBits := candidateBlock.BlockHeader.Bits
nonce := GetRandomNonce()
Expand Down

0 comments on commit dc345fc

Please sign in to comment.