Page MenuHomePhabricator

Merge #9963: util: Properly handle errors during log message formatting
ClosedPublic

Authored by nakihito on Sat, Jan 18, 00:45.

Details

Reviewers
deadalnix
Fabien
jasonbcox
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABCe87be9ab6925: Merge #9963: util: Properly handle errors during log message formatting
Summary

b651270 util: Throw tinyformat::format_error on formatting error (Wladimir J. van der Laan)
3b092bd util: Properly handle errors during log message formatting (Wladimir J. van der Laan)

Tree-SHA512: 85e3b7afec2255fc88034187f1abd6060e9421de17ed4e3d918416f393429a99cc2c974b362099aaaff6970549df47664bea4c857c4e46acc0789663201dc541

Merge #10010: util: rename variable to avoid shadowing

9350e13 util: rename variable to avoid shadowing (Pavol Rusnak)

Tree-SHA512: 8abc09fdb134c913e823754f3f02a4d8ef120a73f252fbc1217dbd2bdd4ed4fffce92d823a66d1fe51607dc021065df8826f21274ef26e55d82575e96d07224f

Backport of Core PR9963 and PR10010
https://github.com/bitcoin/bitcoin/pull/9963/
https://github.com/bitcoin/bitcoin/pull/10010/

Also needed to pull a change from PR12954:
https://github.com/bitcoin/bitcoin/pull/12954/files#diff-772f489c7d0a32de3badbfbcb5fd200dR69

Test Plan

Change line init.cpp line 1584 to LogPrintf("Checkpoints will be verified.\n", fCheckpointsEnabled);

make check
./bitcoind

Verify the following log message appears at start up:

2020-01-18T00:33:40Z Error "tinyformat: Not enough conversion specifiers in format string" while formatting log message: Checkpoints will be verified.

Undo change to init.cpp and repeat above verifying normal, pre-patch behavior

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

nakihito created this revision.Sat, Jan 18, 00:45
Owners added a reviewer: Restricted Owners Package.Sat, Jan 18, 00:46
Herald added a reviewer: Restricted Project. · View Herald TranscriptSat, Jan 18, 00:46
nakihito updated this revision to Diff 15636.Sat, Jan 18, 00:58

Fixed comment formatting.

deadalnix accepted this revision.Sat, Jan 18, 23:39
This revision is now accepted and ready to land.Sat, Jan 18, 23:39