aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2020-04-30 18:20:01 -0700
committerSuhas Daftuar <sdaftuar@gmail.com>2020-07-18 19:00:01 -0400
commitc7eb6b4f1fe5bd76388a023529977674534334a7 (patch)
treeaf43adf8cbb691da6e6b330c2b14926985cb0775 /src/txmempool.h
parent2b4b90aa8f0440deacefb5997d7bd1f9f5c591b3 (diff)
downloadbitcoin-c7eb6b4f1fe5bd76388a023529977674534334a7.tar.xz
Add wtxid to mempool unbroadcast tracking
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index 80cde0750c..d4e9845942 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -573,8 +573,11 @@ private:
std::vector<indexed_transaction_set::const_iterator> GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs);
- /** track locally submitted transactions to periodically retry initial broadcast */
- std::set<uint256> m_unbroadcast_txids GUARDED_BY(cs);
+ /**
+ * track locally submitted transactions to periodically retry initial broadcast
+ * map of txid -> wtxid
+ */
+ std::map<uint256, uint256> m_unbroadcast_txids GUARDED_BY(cs);
public:
indirectmap<COutPoint, const CTransaction*> mapNextTx GUARDED_BY(cs);
@@ -734,11 +737,11 @@ public:
size_t DynamicMemoryUsage() const;
/** Adds a transaction to the unbroadcast set */
- void AddUnbroadcastTx(const uint256& txid) {
+ void AddUnbroadcastTx(const uint256& txid, const uint256& wtxid) {
LOCK(cs);
// Sanity Check: the transaction should also be in the mempool
if (exists(txid)) {
- m_unbroadcast_txids.insert(txid);
+ m_unbroadcast_txids[txid] = wtxid;
}
}
@@ -746,7 +749,7 @@ public:
void RemoveUnbroadcastTx(const uint256& txid, const bool unchecked = false);
/** Returns transactions in unbroadcast set */
- std::set<uint256> GetUnbroadcastTxs() const {
+ std::map<uint256, uint256> GetUnbroadcastTxs() const {
LOCK(cs);
return m_unbroadcast_txids;
}