File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -225,17 +225,13 @@ bool BaseIndex::Commit()
225225{
226226 // Don't commit anything if we haven't indexed any block yet
227227 // (this could happen if init is interrupted).
228- bool ok = m_best_block_index != nullptr ;
229- if (ok) {
228+ if (m_best_block_index != nullptr ) {
230229 CDBBatch batch (GetDB ());
231- ok = CustomCommit (batch);
232- if (ok) {
233- GetDB ().WriteBestBlock (batch, GetLocator (*m_chain, m_best_block_index.load ()->GetBlockHash ()));
234- ok = GetDB ().WriteBatch (batch);
235- }
236- }
237- if (!ok) {
238- return error (" %s: Failed to commit latest %s state" , __func__, GetName ());
230+ if (!CustomCommit (batch))
231+ return error (" %s: Failed to CustomCommit latest %s state" , __func__, GetName ());
232+ GetDB ().WriteBestBlock (batch, GetLocator (*m_chain, m_best_block_index.load ()->GetBlockHash ()));
233+ if (!GetDB ().WriteBatch (batch))
234+ return error (" %s: Failed to commit latest %s state" , __func__, GetName ());
239235 }
240236 return true ;
241237}
You can’t perform that action at this time.
0 commit comments