From 464f18f50c8ae8a06857e49e607f2ad0f9317925 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 30 Apr 2019 15:51:12 +0300 Subject: [PATCH] wallet2: don't move coinbase txs into unconfirmed_txs container --- src/wallet/wallet2.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 57586210..4a54554a 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1658,12 +1658,21 @@ void wallet2::detach_blockchain(uint64_t height) break; tr_hist_it = it; // note that tr_hist_it->height >= height } + if (tr_hist_it != m_transfer_history.rend()) { auto it_from = --tr_hist_it.base(); - // before removing wti from m_transfer_history put it into m_unconfirmed_txs as txs from detached blocks are most likely moved into the pool + // before removing wti from m_transfer_history put it into m_unconfirmed_txs as txs from detached blocks are most likely be moved into the pool for (auto it = it_from; it != m_transfer_history.end(); ++it) { + // skip coinbase txs as they are not expected to go into the pool + if (is_coinbase(it->tx)) + { + if (!it->is_mining) + WLT_LOG_ERROR("is_mining flag is not consistent for tx " << it ->tx_hash); + continue; + } + if (!m_unconfirmed_txs.insert(std::make_pair(it->tx_hash, *it)).second) { WLT_LOG_ERROR("can't move wti from transfer history to unronfirmed txs because such it is already here, tx hash: " << it->tx_hash);