aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorgzhao408 <gzhao408@berkeley.edu>2020-04-29 14:19:37 -0700
committergzhao408 <gzhao408@berkeley.edu>2020-05-19 14:23:13 -0700
commita7ebe48b94c5a9195c8eabd193204c499cb4bfdb (patch)
tree86fb5ff2d32de4199dc1bbd09838e516914241f4 /src/txmempool.h
parentd16006960443c2efe37c896e46edae9dca86c57d (diff)
downloadbitcoin-a7ebe48b94c5a9195c8eabd193204c499cb4bfdb.tar.xz
[rpc] add unbroadcast info to mempool entries and getmempoolinfo
- expose info about number of txns in unbroadcast set and whether a mempool entry's tx has passed initial broadcast - makes rpcs more informative and allows for more explicit testing, eg tracking if tx is in unbroadcast set before and after originating node connects to peers (adds this in mempool_unbroadcast.py) - adds mempool method IsUnbroadcastTx to query for tx inclusion in mempool's unbroadcast set
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index 4bee78b8d6..0f3ae3630c 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -716,6 +716,12 @@ public:
return m_unbroadcast_txids;
}
+ // Returns if a txid is in the unbroadcast set
+ bool IsUnbroadcastTx(const uint256& txid) const {
+ LOCK(cs);
+ return (m_unbroadcast_txids.count(txid) != 0);
+ }
+
private:
/** UpdateForDescendants is used by UpdateTransactionsFromBlock to update
* the descendants for a single transaction that has been added to the