Closed driquelme closed 2 years ago
template<typename URNG, typename T>
T popRandomValue(URNG& randomGenerator, std::vector<T>& vec) {
assert(!vec.empty());
if (vec.empty()) {
return T();
}
std::uniform_int_distribution<size_t> distribution(0, vec.size() - 1);
size_t idx = distribution(randomGenerator);
T res = vec[idx];
if (idx + 1 != vec.size()) {
vec[idx] = vec.back();
}
vec.resize(vec.size() - 1);
return res;
}
Another instance of this problem is when I attempt a transfer using an RPC wallet. I get the following error. The wallet has funds and its height matches the daemon height. Mining is pauses at the time of transfer. It sometimes works, but generally,
Unable to make transfer, code: -4, Internal node error
I figured it out, I was sending a smaller fee than the lower limit.
When I attempt a transfer using a wallet with enough balance in testnet I get the following assertion failure.
cc: @yerkobits