mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-14 01:27:24 +02:00
scripted-diff: rename block and undo functions for consistency
Co-authored-by: Ryan Ofsky <ryan@ofsky.org> Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com> -BEGIN VERIFY SCRIPT- grep -r -wE 'WriteBlock|ReadRawBlock|ReadBlock|WriteBlockUndo|ReadBlockUndo' $(git ls-files src/ ':!src/leveldb') && \ echo "Error: One or more target names already exist!" && exit 1 sed -i \ -e 's/\bSaveBlockToDisk/WriteBlock/g' \ -e 's/\bReadRawBlockFromDisk/ReadRawBlock/g' \ -e 's/\bReadBlockFromDisk/ReadBlock/g' \ -e 's/\bWriteUndoDataForBlock/WriteBlockUndo/g' \ -e 's/\bUndoReadFromDisk/ReadBlockUndo/g' \ $(git ls-files src/ ':!src/leveldb') -END VERIFY SCRIPT-
This commit is contained in:
@@ -123,7 +123,7 @@ bool CoinStatsIndex::CustomAppend(const interfaces::BlockInfo& block)
|
||||
// pindex variable gives indexing code access to node internals. It
|
||||
// will be removed in upcoming commit
|
||||
const CBlockIndex* pindex = WITH_LOCK(cs_main, return m_chainstate->m_blockman.LookupBlockIndex(block.hash));
|
||||
if (!m_chainstate->m_blockman.UndoReadFromDisk(block_undo, *pindex)) {
|
||||
if (!m_chainstate->m_blockman.ReadBlockUndo(block_undo, *pindex)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ bool CoinStatsIndex::CustomRewind(const interfaces::BlockRef& current_tip, const
|
||||
do {
|
||||
CBlock block;
|
||||
|
||||
if (!m_chainstate->m_blockman.ReadBlockFromDisk(block, *iter_tip)) {
|
||||
if (!m_chainstate->m_blockman.ReadBlock(block, *iter_tip)) {
|
||||
LogError("%s: Failed to read block %s from disk\n",
|
||||
__func__, iter_tip->GetBlockHash().ToString());
|
||||
return false;
|
||||
@@ -415,7 +415,7 @@ bool CoinStatsIndex::ReverseBlock(const CBlock& block, const CBlockIndex* pindex
|
||||
|
||||
// Ignore genesis block
|
||||
if (pindex->nHeight > 0) {
|
||||
if (!m_chainstate->m_blockman.UndoReadFromDisk(block_undo, *pindex)) {
|
||||
if (!m_chainstate->m_blockman.ReadBlockUndo(block_undo, *pindex)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user