@ -23,7 +23,7 @@
static const uint64_t GB_BYTES = 1000000000LL ;
static const uint64_t GB_BYTES = 1000000000LL ;
/* Minimum free space (in GB) needed for data directory */
/* Minimum free space (in GB) needed for data directory */
static const uint64_t BLOCK_CHAIN_SIZE = 8 0;
static const uint64_t BLOCK_CHAIN_SIZE = 12 0;
/* Minimum free space (in GB) needed for data directory when pruned; Does not include prune target */
/* Minimum free space (in GB) needed for data directory when pruned; Does not include prune target */
static const uint64_t CHAIN_STATE_SIZE = 2 ;
static const uint64_t CHAIN_STATE_SIZE = 2 ;
/* Total required space (in GB) depending on user choice (prune, not prune) */
/* Total required space (in GB) depending on user choice (prune, not prune) */
@ -126,8 +126,13 @@ Intro::Intro(QWidget *parent) :
ui - > storageLabel - > setText ( ui - > storageLabel - > text ( ) . arg ( tr ( PACKAGE_NAME ) ) ) ;
ui - > storageLabel - > setText ( ui - > storageLabel - > text ( ) . arg ( tr ( PACKAGE_NAME ) ) ) ;
uint64_t pruneTarget = std : : max < int64_t > ( 0 , GetArg ( " -prune " , 0 ) ) ;
uint64_t pruneTarget = std : : max < int64_t > ( 0 , GetArg ( " -prune " , 0 ) ) ;
requiredSpace = BLOCK_CHAIN_SIZE ;
requiredSpace = BLOCK_CHAIN_SIZE ;
if ( pruneTarget )
if ( pruneTarget ) {
requiredSpace = CHAIN_STATE_SIZE + std : : ceil ( pruneTarget * 1024 * 1024.0 / GB_BYTES ) ;
uint64_t prunedGBs = std : : ceil ( pruneTarget * 1024 * 1024.0 / GB_BYTES ) ;
if ( prunedGBs < = requiredSpace ) {
requiredSpace = prunedGBs ;
}
}
requiredSpace + = CHAIN_STATE_SIZE ;
ui - > sizeWarningLabel - > setText ( ui - > sizeWarningLabel - > text ( ) . arg ( tr ( PACKAGE_NAME ) ) . arg ( requiredSpace ) ) ;
ui - > sizeWarningLabel - > setText ( ui - > sizeWarningLabel - > text ( ) . arg ( tr ( PACKAGE_NAME ) ) . arg ( requiredSpace ) ) ;
startThread ( ) ;
startThread ( ) ;
}
}