diff options
author | fanquake <fanquake@gmail.com> | 2024-03-12 09:39:07 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2024-03-12 10:05:06 +0000 |
commit | 31be1a47675e4449f856e61beb2b4bfc228ea219 (patch) | |
tree | d9ead51b2f7dce87ab4e903730a177b0b274d1ef /src/net.cpp | |
parent | e70590988a7b19aca2e3cc2c91d067347b1915ec (diff) | |
parent | fa391513949b7a3b56321436e2015c7e9e6dac2b (diff) | |
download | bitcoin-31be1a47675e4449f856e61beb2b4bfc228ea219.tar.xz |
Merge bitcoin/bitcoin#29236: log: Nuke error(...)
fa391513949b7a3b56321436e2015c7e9e6dac2b refactor: Remove unused error() (MarcoFalke)
fad0335517096f435d76adce7833e213d3cc23d1 scripted-diff: Replace error() with LogError() (MarcoFalke)
fa808fb74972637840675e310f6d4a0f06028d61 refactor: Make error() return type void (MarcoFalke)
fa1d62434843866d242bff9f9c55cb838a4f0d83 scripted-diff: return error(...); ==> error(...); return false; (MarcoFalke)
fa9a5e80ab86c997102a1c3d4ba017bbe86641d5 refactor: Add missing {} around error() calls (MarcoFalke)
Pull request description:
`error(...)` has many issues:
* It is often used in the context of `return error(...)`, implying that it has a "fancy" type, creating confusion with `util::Result/Error`
* `-logsourcelocations` does not work with it, because it will pretend the error happened inside of `logging.h`
* The log line contains `ERROR: `, as opposed to `[error]`, like for other errors logged with `LogError`.
Fix all issues by removing it.
ACKs for top commit:
fjahr:
re-utACK fa391513949b7a3b56321436e2015c7e9e6dac2b
stickies-v:
re-ACK fa391513949b7a3b56321436e2015c7e9e6dac2b, no changes since 4a903741b0
ryanofsky:
Code review ACK fa391513949b7a3b56321436e2015c7e9e6dac2b. Just rebase since last review
Tree-SHA512: ec5bb502ab0d3733fdb14a8a00762638fce0417afd8dd6294ae0d485ce2b7ca5b1efeb50fc2cd7467f6c652e4ed3e99b0f283b08aeca04bbfb7ea4f2c95d283a
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index 2fbfd75261..e8d8f370dd 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -570,7 +570,7 @@ void CNode::SetAddrLocal(const CService& addrLocalIn) { AssertLockNotHeld(m_addr_local_mutex); LOCK(m_addr_local_mutex); if (addrLocal.IsValid()) { - error("Addr local already set for node: %i. Refusing to change from %s to %s", id, addrLocal.ToStringAddrPort(), addrLocalIn.ToStringAddrPort()); + LogError("Addr local already set for node: %i. Refusing to change from %s to %s\n", id, addrLocal.ToStringAddrPort(), addrLocalIn.ToStringAddrPort()); } else { addrLocal = addrLocalIn; } |