mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 18:52:29 +02:00
move-only: Create src/kernel/mempool_removal_reason.h
This is needed for a future commit. Can be reviewed with: --color-moved=dimmed-zebra
This commit is contained in:
21
src/kernel/mempool_removal_reason.cpp
Normal file
21
src/kernel/mempool_removal_reason.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) 2016-present The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or https://opensource.org/license/mit/.
|
||||
|
||||
#include <kernel/mempool_removal_reason.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
|
||||
std::string RemovalReasonToString(const MemPoolRemovalReason& r) noexcept
|
||||
{
|
||||
switch (r) {
|
||||
case MemPoolRemovalReason::EXPIRY: return "expiry";
|
||||
case MemPoolRemovalReason::SIZELIMIT: return "sizelimit";
|
||||
case MemPoolRemovalReason::REORG: return "reorg";
|
||||
case MemPoolRemovalReason::BLOCK: return "block";
|
||||
case MemPoolRemovalReason::CONFLICT: return "conflict";
|
||||
case MemPoolRemovalReason::REPLACED: return "replaced";
|
||||
}
|
||||
assert(false);
|
||||
}
|
||||
24
src/kernel/mempool_removal_reason.h
Normal file
24
src/kernel/mempool_removal_reason.h
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2016-present The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or https://opensource.org/license/mit/.
|
||||
|
||||
#ifndef BITCOIN_KERNEL_MEMPOOL_REMOVAL_REASON_H
|
||||
#define BITCOIN_KERNEL_MEMPOOL_REMOVAL_REASON_H
|
||||
|
||||
#include <string>
|
||||
|
||||
/** Reason why a transaction was removed from the mempool,
|
||||
* this is passed to the notification signal.
|
||||
*/
|
||||
enum class MemPoolRemovalReason {
|
||||
EXPIRY, //!< Expired from mempool
|
||||
SIZELIMIT, //!< Removed in size limiting
|
||||
REORG, //!< Removed for reorganization
|
||||
BLOCK, //!< Removed for block
|
||||
CONFLICT, //!< Removed for conflict with in-block transaction
|
||||
REPLACED, //!< Removed for replacement
|
||||
};
|
||||
|
||||
std::string RemovalReasonToString(const MemPoolRemovalReason& r) noexcept;
|
||||
|
||||
#endif // BITCOIN_KERNEL_MEMPOOL_REMOVAL_REASON_H
|
||||
Reference in New Issue
Block a user