mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-26 00:55:08 +01:00
Bitcoin pruning will be disabled/not asked for during config, when lightning is enabled
This commit is contained in:
@@ -213,8 +213,10 @@ module.exports = class extends Generator {
|
||||
delete this.props.lightning_version;
|
||||
delete this.props.grafana_version;
|
||||
}
|
||||
|
||||
|
||||
this._assignConfigDefaults();
|
||||
this._resolveConfigConflicts();
|
||||
|
||||
for( let c of this.featureChoices ) {
|
||||
c.checked = this._isChecked( 'features', c.value );
|
||||
}
|
||||
@@ -324,6 +326,8 @@ module.exports = class extends Generator {
|
||||
}
|
||||
|
||||
async writing() {
|
||||
this._resolveConfigConflicts()
|
||||
|
||||
const configJsonString = JSON.stringify(this.props, null, 4);
|
||||
const archive = new Archive( this.destinationPath('config.7z'), this.configurationPassword );
|
||||
|
||||
@@ -383,6 +387,13 @@ module.exports = class extends Generator {
|
||||
|
||||
/* some utils */
|
||||
|
||||
_resolveConfigConflicts() {
|
||||
if( this.props.features.indexOf('lightning') !== -1 ) {
|
||||
this.props.bitcoin_prune = false;
|
||||
delete this.props.bitcoin_prune_size;
|
||||
}
|
||||
}
|
||||
|
||||
_assignConfigDefaults() {
|
||||
this.props = Object.assign( {
|
||||
features: [],
|
||||
|
||||
@@ -23,7 +23,7 @@ const bitcoinInternalAndPrune = function(props) {
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
name: function() {
|
||||
name: function() {
|
||||
return name;
|
||||
},
|
||||
prompts: function( utils ) {
|
||||
@@ -68,14 +68,18 @@ module.exports = {
|
||||
filter: utils._trimFilter,
|
||||
},
|
||||
{
|
||||
when: bitcoinInternal,
|
||||
when: function(props) {
|
||||
return bitcoinInternal( props ) && props.features.indexOf('lightning') === -1;
|
||||
},
|
||||
type: 'confirm',
|
||||
name: 'bitcoin_prune',
|
||||
default: utils._getDefault( 'bitcoin_prune' ),
|
||||
message: prefix()+'Run bitcoin node in prune mode?'+utils._getHelp('bitcoin_prune'),
|
||||
},
|
||||
{
|
||||
when: bitcoinInternalAndPrune,
|
||||
when: function(props) {
|
||||
return bitcoinInternalAndPrune( props ) && props.features.indexOf('lightning') === -1;
|
||||
},
|
||||
type: 'input',
|
||||
name: 'bitcoin_prune_size',
|
||||
default: utils._getDefault( 'bitcoin_prune_size' ),
|
||||
Reference in New Issue
Block a user