| 234 | } |
| 235 | |
| 236 | BinaryArray 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 | |
| 254 | void 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 || |
no test coverage detected