mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 11:44:14 +01:00
Merge bitcoin/bitcoin#30429: rpc: Use CHECK_NONFATAL over Assert
fa6270737erpc: Use CHECK_NONFATAL over Assert (MarcoFalke) Pull request description: Any RPC method should not abort the whole node when an internal logic error happens. Fix it by just aborting this single RPC method call when an error happens. Also, fix the linter to find the fixed cases. ACKs for top commit: achow101: ACKfa6270737estickies-v: ACKfa6270737etdb3: ACKfa6270737ehodlinator: ACKfa6270737eTree-SHA512: dad2f31b01a66578949009499e4385fb4d72f0f897419f2a6e0ea02e799b9a31e6ecb5a67fa5d27fcbc7939fe8acd62dc04e877b35831493b7f2c604dec7dc64
This commit is contained in:
@@ -27,8 +27,9 @@ def main():
|
||||
# checks should be used over assert. See: src/util/check.h
|
||||
# src/rpc/server.cpp is excluded from this check since it's mostly meta-code.
|
||||
exit_code = git_grep([
|
||||
"-nE",
|
||||
r"\<(A|a)ss(ume|ert) *\(.*\);",
|
||||
"--line-number",
|
||||
"--extended-regexp",
|
||||
r"\<(A|a)ss(ume|ert)\(",
|
||||
"--",
|
||||
"src/rpc/",
|
||||
"src/wallet/rpc*",
|
||||
@@ -38,8 +39,9 @@ def main():
|
||||
# The `BOOST_ASSERT` macro requires to `#include boost/assert.hpp`,
|
||||
# which is an unnecessary Boost dependency.
|
||||
exit_code |= git_grep([
|
||||
"-E",
|
||||
r"BOOST_ASSERT *\(.*\);",
|
||||
"--line-number",
|
||||
"--extended-regexp",
|
||||
r"BOOST_ASSERT\(",
|
||||
"--",
|
||||
"*.cpp",
|
||||
"*.h",
|
||||
|
||||
Reference in New Issue
Block a user