mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
fa57cb9512
e20c72f9f076681def325b5b5fa53bccda2b0eab Fire TransactionRemovedFromMempool from mempool (251) Pull request description: This pull request fires TransactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code. It also resolves the `txmempool -> validation -> validationinterface -> txmempool` circular dependency. Ideally, `validationinterface` is a dumb component that doesn't have any knowledge of the sub-systems it sends its notifications to. The commit that aims to resolve this circular dependency by moving `txmempool` specific code out of `validationinterface` to `txmempool` where it belongs. ACKs for top commit: jnewbery: ACK e20c72f9f076681def325b5b5fa53bccda2b0eab Tree-SHA512: 354c3ff1113b21a0b511d80d604edfe3846dddae3355e43d1387f68906e54bf5dc01e7c029edc0b8e635b500b2ab97ee50362e2486eb4319f7347ee9a9e6cef3
133 lines
6.4 KiB
Bash
Executable File
133 lines
6.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Copyright (c) 2018 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
#
|
|
# Check for circular dependencies
|
|
|
|
export LC_ALL=C
|
|
|
|
EXPECTED_CIRCULAR_DEPENDENCIES=(
|
|
"chainparamsbase -> util/system -> chainparamsbase"
|
|
"index/txindex -> validation -> index/txindex"
|
|
"policy/fees -> txmempool -> policy/fees"
|
|
"qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel"
|
|
"qt/bitcoingui -> qt/walletframe -> qt/bitcoingui"
|
|
"qt/paymentserver -> qt/walletmodel -> qt/paymentserver"
|
|
"qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel"
|
|
"qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel"
|
|
"qt/walletmodel -> qt/walletmodeltransaction -> qt/walletmodel"
|
|
"txmempool -> validation -> txmempool"
|
|
"wallet/fees -> wallet/wallet -> wallet/fees"
|
|
"wallet/wallet -> wallet/walletdb -> wallet/wallet"
|
|
"wallet/scriptpubkeyman -> wallet/wallet -> wallet/scriptpubkeyman"
|
|
# Dash
|
|
"coinjoin/server -> net_processing -> coinjoin/server"
|
|
"evo/cbtx -> evo/simplifiedmns -> evo/cbtx"
|
|
"evo/deterministicmns -> evo/simplifiedmns -> evo/deterministicmns"
|
|
"evo/deterministicmns -> llmq/commitment -> evo/deterministicmns"
|
|
"evo/deterministicmns -> llmq/utils -> evo/deterministicmns"
|
|
"evo/mnauth -> net_processing -> evo/mnauth"
|
|
"governance/classes -> governance/governance -> governance/classes"
|
|
"governance/governance -> governance/object -> governance/governance"
|
|
"governance/governance -> masternode/sync -> governance/governance"
|
|
"governance/governance -> net_processing -> governance/governance"
|
|
"governance/object -> governance/validators -> governance/object"
|
|
"llmq/quorums -> llmq/utils -> llmq/quorums"
|
|
"llmq/blockprocessor -> net_processing -> llmq/blockprocessor"
|
|
"llmq/chainlocks -> llmq/instantsend -> llmq/chainlocks"
|
|
"llmq/chainlocks -> net_processing -> llmq/chainlocks"
|
|
"llmq/dkgsessionmgr -> net_processing -> llmq/dkgsessionmgr"
|
|
"llmq/instantsend -> net_processing -> llmq/instantsend"
|
|
"llmq/instantsend -> txmempool -> llmq/instantsend"
|
|
"llmq/instantsend -> validation -> llmq/instantsend"
|
|
"llmq/signing -> llmq/signing_shares -> llmq/signing"
|
|
"llmq/signing -> net_processing -> llmq/signing"
|
|
"llmq/signing_shares -> net_processing -> llmq/signing_shares"
|
|
"logging -> util/system -> logging"
|
|
"masternode/payments -> validation -> masternode/payments"
|
|
"masternode/sync -> validation -> masternode/sync"
|
|
"net -> netmessagemaker -> net"
|
|
"net_processing -> spork -> net_processing"
|
|
"netaddress -> netbase -> netaddress"
|
|
"qt/appearancewidget -> qt/guiutil -> qt/appearancewidget"
|
|
"qt/bitcoinaddressvalidator -> qt/guiutil -> qt/bitcoinaddressvalidator"
|
|
"qt/bitcoingui -> qt/guiutil -> qt/bitcoingui"
|
|
"qt/guiutil -> qt/optionsdialog -> qt/guiutil"
|
|
"qt/guiutil -> qt/qvalidatedlineedit -> qt/guiutil"
|
|
"core_io -> evo/cbtx -> evo/deterministicmns -> core_io"
|
|
"core_io -> evo/cbtx -> evo/simplifiedmns -> core_io"
|
|
"evo/simplifiedmns -> llmq/blockprocessor -> net_processing -> evo/simplifiedmns"
|
|
"llmq/dkgsession -> llmq/dkgsessionmgr -> llmq/dkgsessionhandler -> llmq/dkgsession"
|
|
"logging -> util/system -> sync -> logging"
|
|
"logging -> util/system -> stacktraces -> logging"
|
|
"logging -> util/system -> util/getuniquepath -> random -> logging"
|
|
"coinjoin/client -> coinjoin/util -> wallet/wallet -> coinjoin/client"
|
|
"qt/appearancewidget -> qt/guiutil -> qt/optionsdialog -> qt/appearancewidget"
|
|
"qt/guiutil -> qt/optionsdialog -> qt/optionsmodel -> qt/guiutil"
|
|
"evo/deterministicmns -> evo/simplifiedmns -> llmq/blockprocessor -> net_processing -> evo/deterministicmns"
|
|
|
|
"coinjoin/client -> net_processing -> coinjoin/client"
|
|
"llmq/quorums -> net_processing -> llmq/quorums"
|
|
"llmq/dkgsession -> llmq/dkgsessionmgr -> llmq/dkgsession"
|
|
"evo/deterministicmns -> evo/simplifiedmns -> llmq/blockprocessor -> net_processing -> txmempool -> evo/deterministicmns"
|
|
"llmq/chainlocks -> validation -> llmq/chainlocks"
|
|
"coinjoin/coinjoin -> llmq/chainlocks -> net -> coinjoin/coinjoin"
|
|
"evo/deterministicmns -> llmq/utils -> net -> evo/deterministicmns"
|
|
"policy/fees -> txmempool -> validation -> policy/fees"
|
|
"policy/policy -> policy/settings -> policy/policy"
|
|
"evo/specialtxman -> validation -> evo/specialtxman"
|
|
|
|
"evo/simplifiedmns -> llmq/blockprocessor -> net_processing -> llmq/snapshot -> evo/simplifiedmns"
|
|
"llmq/blockprocessor -> net_processing -> llmq/context -> llmq/blockprocessor"
|
|
"llmq/blockprocessor -> net_processing -> llmq/snapshot -> llmq/blockprocessor"
|
|
"llmq/chainlocks -> net_processing -> llmq/context -> llmq/chainlocks"
|
|
"llmq/context -> llmq/dkgsessionmgr -> net_processing -> llmq/context"
|
|
"llmq/dkgsession -> llmq/dkgsessionmgr -> llmq/quorums -> llmq/dkgsession"
|
|
"llmq/dkgsessionmgr -> llmq/quorums -> llmq/dkgsessionmgr"
|
|
"llmq/snapshot -> llmq/utils -> llmq/snapshot"
|
|
"spork -> validation -> spork"
|
|
"governance/governance -> validation -> governance/governance"
|
|
)
|
|
|
|
EXIT_CODE=0
|
|
|
|
CIRCULAR_DEPENDENCIES=()
|
|
|
|
IFS=$'\n'
|
|
for CIRC in $(cd src && ../contrib/devtools/circular-dependencies.py {*,*/*,*/*/*}.{h,cpp} | sed -e 's/^Circular dependency: //'); do
|
|
CIRCULAR_DEPENDENCIES+=( "$CIRC" )
|
|
IS_EXPECTED_CIRC=0
|
|
for EXPECTED_CIRC in "${EXPECTED_CIRCULAR_DEPENDENCIES[@]}"; do
|
|
if [[ "${CIRC}" == "${EXPECTED_CIRC}" ]]; then
|
|
IS_EXPECTED_CIRC=1
|
|
break
|
|
fi
|
|
done
|
|
if [[ ${IS_EXPECTED_CIRC} == 0 ]]; then
|
|
echo "A new circular dependency in the form of \"${CIRC}\" appears to have been introduced."
|
|
echo
|
|
EXIT_CODE=1
|
|
fi
|
|
done
|
|
|
|
for EXPECTED_CIRC in "${EXPECTED_CIRCULAR_DEPENDENCIES[@]}"; do
|
|
IS_PRESENT_EXPECTED_CIRC=0
|
|
for CIRC in "${CIRCULAR_DEPENDENCIES[@]}"; do
|
|
if [[ "${CIRC}" == "${EXPECTED_CIRC}" ]]; then
|
|
IS_PRESENT_EXPECTED_CIRC=1
|
|
break
|
|
fi
|
|
done
|
|
if [[ ${IS_PRESENT_EXPECTED_CIRC} == 0 ]]; then
|
|
echo "Good job! The circular dependency \"${EXPECTED_CIRC}\" is no longer present."
|
|
echo "Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in $0"
|
|
echo "to make sure this circular dependency is not accidentally reintroduced."
|
|
echo
|
|
EXIT_CODE=1
|
|
fi
|
|
done
|
|
|
|
exit ${EXIT_CODE}
|