Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
chaingen: Allow 32-bit compile.
Browse files Browse the repository at this point in the history
The go compiler treats the math.MaxUint32 constant as an integer in the
error print which causes a compile error.  This casts the constant to
avoid that thus allows the code to compile on 32-bit architectures.
  • Loading branch information
davecgh committed Mar 7, 2017
1 parent 306cbf9 commit f7d1882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blockchain/chaingen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ func winningTickets(voteBlock *wire.MsgBlock, liveTickets []*stakeTicket, numVot
if numLiveTickets > math.MaxUint32 {
return nil, chainhash.Hash{}, fmt.Errorf("live ticket pool "+
"has %d tickets which is more than the max allowed of "+
"%d", len(liveTickets), math.MaxUint32)
"%d", len(liveTickets), uint32(math.MaxUint32))
}
if uint32(numVotes) > numLiveTickets {
return nil, chainhash.Hash{}, fmt.Errorf("live ticket pool "+
Expand Down

0 comments on commit f7d1882

Please sign in to comment.