diff --git a/KeyFinderLib/KeyFinder.cpp b/KeyFinderLib/KeyFinder.cpp index fb2258f..e54862d 100644 --- a/KeyFinderLib/KeyFinder.cpp +++ b/KeyFinderLib/KeyFinder.cpp @@ -114,7 +114,9 @@ void KeyFinder::setTargetHashes() cudaError_t err = setTargetHash(targets); if(err) { - throw KeyFinderException("Error initializing device"); + std::string cudaErrorString(cudaGetErrorString(err)); + + throw KeyFinderException("Error initializing device: " + cudaErrorString); } } @@ -145,7 +147,12 @@ void KeyFinder::init() secp256k1::ecpoint g = secp256k1::G(); secp256k1::ecpoint p = secp256k1::multiplyPoint(secp256k1::uint256(_numThreads * _numBlocks * _pointsPerThread), g); - if(setIncrementorPoint(p.x, p.y)) { + cudaError_t err = setIncrementorPoint(p.x, p.y); + if(err) { + std::string cudaErrorString(cudaGetErrorString(err)); + + throw KeyFinderException("Error initializing device: " + cudaErrorString); + throw KeyFinderException("Error initializing device"); } } diff --git a/KeyFinderLib/KeyFinder.cu b/KeyFinderLib/KeyFinder.cu index d5d199e..354b8ff 100644 --- a/KeyFinderLib/KeyFinder.cu +++ b/KeyFinderLib/KeyFinder.cu @@ -109,7 +109,7 @@ static cudaError_t setTargetBloomFilter(const std::vector &targe undoRMD160FinalRound(targets[i].h, h); for(int j = 0; j < 5; j++) { - unsigned int idx = h[i] & 0xffff; + unsigned int idx = h[j] & 0xffff; filter[idx / 32] |= (0x01 << (idx % 32)); }