MCPcopy Create free account
hub / github.com/bcndev/bytecoin / get_next_from_sending_queue

Method get_next_from_sending_queue

src/Core/WalletState.cpp:236–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236BinaryArray WalletState::get_next_from_sending_queue(Hash *previous_hash) {
237 auto &by_hash_index = payment_queue.get<by_hash>();
238 // std::cout << "by_hash_index.size=" << by_hash_index.size() << std::endl;
239 // for(auto && bhit : by_hash_index)
240 // std::cout << " " << bhit.hash << std::endl;
241 auto git = by_hash_index.lower_bound(*previous_hash);
242 if (git == by_hash_index.end())
243 return BinaryArray{};
244 if (git->hash == *previous_hash) // Otherwise previous tx was removed
245 ++git;
246 while (git != by_hash_index.end() && git->in_blockchain())
247 ++git;
248 if (git == by_hash_index.end())
249 return BinaryArray{};
250 *previous_hash = git->hash;
251 return git->binary_transaction;
252}
253
254void WalletState::process_payment_queue_send_error(Hash hash, const api::cnd::SendTransaction::Error &error) {
255 if (error.code == api::cnd::SendTransaction::INVALID_TRANSACTION_BINARY_FORMAT ||

Callers 1

send_send_transactionMethod · 0.80

Calls 2

in_blockchainMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected