mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge aeb395dcdb into merged_master (Bitcoin PR bitcoin/bitcoin#25315)
This commit is contained in:
commit
e7850e19b3
3 changed files with 22 additions and 6 deletions
20
src/init.cpp
20
src/init.cpp
|
|
@ -1754,6 +1754,24 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
return false;
|
||||
}
|
||||
|
||||
int chain_active_height = WITH_LOCK(cs_main, return chainman.ActiveChain().Height());
|
||||
|
||||
// On first startup, warn on low block storage space
|
||||
if (!fReindex && !fReindexChainState && chain_active_height <= 1) {
|
||||
uint64_t additional_bytes_needed = fPruneMode ? nPruneTarget
|
||||
: chainparams.AssumedBlockchainSize() * 1024 * 1024 * 1024;
|
||||
|
||||
if (!CheckDiskSpace(args.GetBlocksDirPath(), additional_bytes_needed)) {
|
||||
InitWarning(strprintf(_(
|
||||
"Disk space for %s may not accommodate the block files. " \
|
||||
"Approximately %u GB of data will be stored in this directory."
|
||||
),
|
||||
fs::quoted(fs::PathToString(args.GetBlocksDirPath())),
|
||||
chainparams.AssumedBlockchainSize()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Either install a handler to notify us when genesis activates, or set fHaveGenesis directly.
|
||||
// No locking, as this happens before any background thread is started.
|
||||
boost::signals2::connection block_notify_genesis_wait_connection;
|
||||
|
|
@ -1803,8 +1821,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
|
||||
// ********************************************************* Step 12: start node
|
||||
|
||||
int chain_active_height;
|
||||
|
||||
//// debug print
|
||||
{
|
||||
LOCK(cs_main);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue