| 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 || |
| 256 | ((error.code == api::cnd::SendTransaction::OUTPUT_ALREADY_SPENT || |
| 257 | error.code == api::cnd::SendTransaction::WRONG_OUTPUT_REFERENCE) && |
| 258 | get_tip_height() > error.conflict_height + m_config.payment_queue_confirmations)) { |
| 259 | m_log(logging::INFO) << "Removing transaction from PQ because send error " << error.what(); |
| 260 | auto &by_hash_index = payment_queue.get<by_hash>(); |
| 261 | auto git = by_hash_index.find(hash); |
| 262 | if (git != by_hash_index.end()) |
| 263 | by_hash_index.erase(git); |
| 264 | remove_transaction_from_mempool(hash, true); |
| 265 | m_wallet.payment_queue_remove(hash); |
| 266 | m_tx_pool_version += 1; |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | const WalletState::QueueEntry *WalletState::find_in_payment_queue(const Hash &hash) { |
| 271 | auto &by_hash_index = payment_queue.get<by_hash>(); |
no test coverage detected