Implement Mini version of BlockAssembler to calculate mining scores

Rewrite the same algo instead of reusing BlockAssembler because we have
a few extra requirements that would make the changes invasive and
difficult to review:

- Only operate on the relevant transactions rather than full mempool
- Remove transactions that will be replaced so they can't bump their ancestors
- Don't hold mempool lock outside of the constructor
- Skip things like max block weight and IsFinalTx
- Additionally calculate fees to bump remaining ancestor packages to target feerate

Co-authored-by: Murch <murch@murch.one>
This commit is contained in:
glozow
2022-08-04 15:37:50 +01:00
committed by Murch
parent 56484f0fdc
commit 59afcc8354
3 changed files with 489 additions and 0 deletions

View File

@@ -211,6 +211,7 @@ BITCOIN_CORE_H = \
node/mempool_args.h \
node/mempool_persist_args.h \
node/miner.h \
node/mini_miner.h \
node/minisketchwrapper.h \
node/psbt.h \
node/transaction.h \
@@ -396,6 +397,7 @@ libbitcoin_node_a_SOURCES = \
node/mempool_args.cpp \
node/mempool_persist_args.cpp \
node/miner.cpp \
node/mini_miner.cpp \
node/minisketchwrapper.cpp \
node/psbt.cpp \
node/transaction.cpp \