From fa8dc3f9f69a4dde30f882081fdb507d2cad7230 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Fri, 26 Oct 2018 08:28:18 -0500 Subject: [PATCH 1/2] Only log integrity hash with snapshot startup --- libraries/chain/controller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/chain/controller.cpp b/libraries/chain/controller.cpp index 6fc72c1e8bc..e5e8cb0aed5 100644 --- a/libraries/chain/controller.cpp +++ b/libraries/chain/controller.cpp @@ -386,7 +386,9 @@ struct controller_impl { db.undo(); } - ilog( "database initialized with hash: ${hash}", ("hash", calculate_integrity_hash())); + if( snapshot ) { + ilog( "database initialized with hash: ${hash}", ("hash", calculate_integrity_hash()) ); + } } From 9b3aaa23e31903efa86d3fea5e5f7a9acc8dfaff Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Fri, 26 Oct 2018 08:33:47 -0500 Subject: [PATCH 2/2] Calculate hash before ilog so timing of log is correct. --- libraries/chain/controller.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/chain/controller.cpp b/libraries/chain/controller.cpp index e5e8cb0aed5..41e9d551728 100644 --- a/libraries/chain/controller.cpp +++ b/libraries/chain/controller.cpp @@ -387,7 +387,8 @@ struct controller_impl { } if( snapshot ) { - ilog( "database initialized with hash: ${hash}", ("hash", calculate_integrity_hash()) ); + const auto hash = calculate_integrity_hash(); + ilog( "database initialized with hash: ${hash}", ("hash", hash) ); } }