Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Fix process extra nonce out of range exception #1900

Merged
merged 1 commit into from
Jun 4, 2019

Conversation

ShengguangXiao
Copy link
Contributor

@ShengguangXiao ShengguangXiao commented Jun 3, 2019

Right now after resize extra nonce to 16 bytes, the std::stoul will raise exception "stoul argument out of range".
Because if server send extra nonce to "abcabc", after run enonce.resize(16, '0');
enonce will be "abcabc0000000000" in hex, it already exceed the max value of uint32_t, need to use the 64 bit version std::stoull to convert hex string to uint64_t type.

C++ reference
https://en.cppreference.com/w/cpp/string/basic_string/stoul

 Fix process extra nonce out of range exception
@MariusVanDerWijden MariusVanDerWijden merged commit 1731307 into ethereum-mining:master Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants