@ -515,13 +515,14 @@ void CWallet::RunSaplingSweep(int blockHeight) {
return ;
}
LogPrintf ( " %s: Sweep enabled at blockHeight=%d nextSweep=%d \n " , __func__ , blockHeight , nextSweep ) ;
if ( nextSweep > blockHeight ) {
return ;
}
//Don't Run if consolidation will run soon.
if ( fSaplingConsolidationEnabled & & nextConsolidation - 5 < = blockHeight ) {
LogPrintf ( " %s: not consolidating since next sweep is within 5 blocks \n " , __func__ ) ;
LogPrintf ( " %s: not sweeping since next consolidation is within 5 blocks, nextConsolidation=%d , blockHeight=%d \n " , __func__ , nextConsolidation , blockHeight ) ;
return ;
}
@ -545,9 +546,10 @@ void CWallet::RunSaplingSweep(int blockHeight) {
}
void CWallet : : RunSaplingConsolidation ( int blockHeight ) {
if ( ! NetworkUpgradeActive ( blockHeight , Params ( ) . GetConsensus ( ) , Consensus : : UPGRADE_SAPLING ) ) {
return ;
}
// Sapling is always active on HUSH+HSCs
//if (!NetworkUpgradeActive(blockHeight, Params().GetConsensus(), Consensus::UPGRADE_SAPLING)) {
// return;
//}
LOCK ( cs_wallet ) ;
@ -555,6 +557,8 @@ void CWallet::RunSaplingConsolidation(int blockHeight) {
return ;
}
LogPrintf ( " %s: consolidation enabled at blockHeight=%d fSweepRunning=%d \n " , __func__ , blockHeight , fSweepRunning ) ;
if ( fSweepRunning ) {
return ;
}
@ -565,6 +569,7 @@ void CWallet::RunSaplingConsolidation(int blockHeight) {
fprintf ( stderr , " %s: height=%d interval=%d \n " , __func__ , blockHeight , consolidateInterval ) ;
if ( blockHeight % consolidateInterval = = 0 ) {
LogPrintf ( " %s: creating consolidation operation at blockHeight=%d \n " , __func__ , blockHeight ) ;
std : : shared_ptr < AsyncRPCQueue > q = getAsyncRPCQueue ( ) ;
std : : shared_ptr < AsyncRPCOperation > lastOperation = q - > getOperationForId ( saplingConsolidationOperationId ) ;
if ( lastOperation ! = nullptr ) {