mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-13 14:13:52 +02:00
mining: add getTransactionsByWitnessID() IPC method
This commit is contained in:
@@ -1048,6 +1048,19 @@ public:
|
||||
return results;
|
||||
}
|
||||
|
||||
std::vector<CTransactionRef> getTransactionsByWitnessID(const std::vector<Wtxid>& wtxids) override
|
||||
{
|
||||
if (!m_node.mempool) return {};
|
||||
|
||||
std::vector<CTransactionRef> results;
|
||||
results.reserve(wtxids.size());
|
||||
LOCK(m_node.mempool->cs);
|
||||
for (const auto& wtxid : wtxids) {
|
||||
results.emplace_back(m_node.mempool->get(wtxid));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
const NodeContext* context() override { return &m_node; }
|
||||
ChainstateManager& chainman() { return *Assert(m_node.chainman); }
|
||||
KernelNotifications& notifications() { return *Assert(m_node.notifications); }
|
||||
|
||||
Reference in New Issue
Block a user