Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor dao monitor handling #5780

Closed
wants to merge 201 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
8fbccb7
Bump version number for v1.7.5
ripcurlx Oct 19, 2021
e39ae59
Update translations for v1.7.5
ripcurlx Oct 19, 2021
48a0ebe
Add new v3 onions for wiz's bitcoin nodes
wiz Oct 19, 2021
577b07b
Move OfferPayload into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
19f813e
Move CreateOfferService into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
d98cb27
Move MarketPriceNotAvailableException into package bisq.core.offer.bi…
chimp1984 Oct 19, 2021
346fc79
Move MutableOfferPayloadFields into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
8a4c05c
Move TriggerPriceService into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
ade5d32
Move TakeOfferModel into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
20d2980
Move AvailabilityResult into package bisq.core.offer.availability
chimp1984 Oct 19, 2021
0107519
Move bisq.core.offer.messages package into package bisq.core.offer.av…
chimp1984 Oct 19, 2021
ed9f248
Move content of bisq.core.offer.placeoffer package into package bisq.…
chimp1984 Oct 19, 2021
b584fdf
Rename OfferFilter to OfferFilterService
chimp1984 Oct 19, 2021
0e23cbe
Move Contract, SellerAsMakerTrade, SellerAsTakerTrade, SellerTrade,
chimp1984 Oct 19, 2021
c0cca78
Make updateDepositTxFromWallet public
chimp1984 Oct 19, 2021
0f7cfa9
Move Trade to bisq.core.trade.model.bisq_v1 package
chimp1984 Oct 19, 2021
5944218
Move MakerTrade and TakerTrade to bisq.core.trade.model package
chimp1984 Oct 19, 2021
5a0145d
Move Tradable to bisq.core.trade.model package
chimp1984 Oct 19, 2021
81ec06d
Move TradableList to bisq.core.trade.model package
chimp1984 Oct 19, 2021
2489bbc
Make FluentProtocol.Event public
chimp1984 Oct 19, 2021
c0d1308
Make setup in FluentProtocol public
chimp1984 Oct 19, 2021
87c12fd
Move protocol classes to bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
babd70c
Move tasks package into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
5099d97
Move TradingPeer into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
a212cec
Move messages package into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
c9817ed
Move ClosedTradableManager, FailedTradesManager into bisq.core.trade.…
chimp1984 Oct 19, 2021
1b74b4e
Rename CleanupMailboxMessages to CleanupMailboxMessagesService
chimp1984 Oct 19, 2021
2141f8f
Move CleanupMailboxMessagesService, ClosedTradeUtil to package bisq.c…
chimp1984 Oct 19, 2021
f871e83
Move TransactionResultHandler, TradeResultHandler to package bisq.cor…
chimp1984 Oct 19, 2021
71c663e
Move TradeDataValidation, DumpDelayedPayoutTx, TradeDataValidation, T…
chimp1984 Oct 19, 2021
26e2676
Rename ProcessModelServiceProvider to Provider
chimp1984 Oct 19, 2021
c282b70
Rename txID to txId
chimp1984 Oct 19, 2021
30dd568
Move createoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
0cd0e16
Move takeoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
4169a87
Move MutableOffer view classes into bisq.desktop.main.offer.bisq_v1 p…
chimp1984 Oct 19, 2021
a2a7e87
Move OfferDataModel, OfferViewUtil into bisq.desktop.main.offer.bisq_…
chimp1984 Oct 19, 2021
a9f4bb7
Rename FeeUtil to OfferViewModelUtil
chimp1984 Oct 19, 2021
1e03aae
Move OfferViewModelUtil into bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
72284d7
Cleanups, refromatting, add final qualifier
chimp1984 Oct 19, 2021
71eec7b
Move TradingPeer to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
e1efc5e
Make setPaymentStartedAckMessage and setDepositTxSentAckMessage public
chimp1984 Oct 19, 2021
760732f
Move ProcessModel to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
94d3638
Remove m52go bitcoin node
m52go Oct 19, 2021
41d9d3f
Move OfferPayload into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
edf5c3e
Move CreateOfferService into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
4341a7e
Move MarketPriceNotAvailableException into package bisq.core.offer.bi…
chimp1984 Oct 19, 2021
042476a
Move MutableOfferPayloadFields into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
d9fd8a4
Move TriggerPriceService into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
e348000
Move TakeOfferModel into package bisq.core.offer.bisq_v1
chimp1984 Oct 19, 2021
a2d1e88
Move AvailabilityResult into package bisq.core.offer.availability
chimp1984 Oct 19, 2021
1badd69
Move bisq.core.offer.messages package into package bisq.core.offer.av…
chimp1984 Oct 19, 2021
7197b31
Move content of bisq.core.offer.placeoffer package into package bisq.…
chimp1984 Oct 19, 2021
1b4c487
Rename OfferFilter to OfferFilterService
chimp1984 Oct 19, 2021
1e9b606
Move Contract, SellerAsMakerTrade, SellerAsTakerTrade, SellerTrade,
chimp1984 Oct 19, 2021
8b21b85
Make updateDepositTxFromWallet public
chimp1984 Oct 19, 2021
d422427
Move Trade to bisq.core.trade.model.bisq_v1 package
chimp1984 Oct 19, 2021
fc3177c
Move MakerTrade and TakerTrade to bisq.core.trade.model package
chimp1984 Oct 19, 2021
58cfcff
Move Tradable to bisq.core.trade.model package
chimp1984 Oct 19, 2021
3474a2b
Move TradableList to bisq.core.trade.model package
chimp1984 Oct 19, 2021
d7b2e99
Make FluentProtocol.Event public
chimp1984 Oct 19, 2021
e3eea63
Make setup in FluentProtocol public
chimp1984 Oct 19, 2021
1b2e798
Move protocol classes to bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
508296c
Move tasks package into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
97906e0
Move TradingPeer into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
cbf2822
Move messages package into bisq.core.trade.protocol.bisq_v1 package
chimp1984 Oct 19, 2021
fd6934c
Move ClosedTradableManager, FailedTradesManager into bisq.core.trade.…
chimp1984 Oct 19, 2021
fe2871b
Rename CleanupMailboxMessages to CleanupMailboxMessagesService
chimp1984 Oct 19, 2021
e80cdf8
Move CleanupMailboxMessagesService, ClosedTradeUtil to package bisq.c…
chimp1984 Oct 19, 2021
956ffc9
Move TransactionResultHandler, TradeResultHandler to package bisq.cor…
chimp1984 Oct 19, 2021
eacf446
Move TradeDataValidation, DumpDelayedPayoutTx, TradeDataValidation, T…
chimp1984 Oct 19, 2021
e1de502
Rename ProcessModelServiceProvider to Provider
chimp1984 Oct 19, 2021
2733af9
Rename txID to txId
chimp1984 Oct 19, 2021
932c0f8
Move createoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
0efa0bd
Move takeoffer package inside bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
601956d
Move MutableOffer view classes into bisq.desktop.main.offer.bisq_v1 p…
chimp1984 Oct 19, 2021
9777005
Move OfferDataModel, OfferViewUtil into bisq.desktop.main.offer.bisq_…
chimp1984 Oct 19, 2021
4a9db79
Rename FeeUtil to OfferViewModelUtil
chimp1984 Oct 19, 2021
25bbad1
Move OfferViewModelUtil into bisq.desktop.main.offer.bisq_v1 package
chimp1984 Oct 19, 2021
777287a
Cleanups, refromatting, add final qualifier
chimp1984 Oct 19, 2021
401880b
Move TradingPeer to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
afed788
Make setPaymentStartedAckMessage and setDepositTxSentAckMessage public
chimp1984 Oct 19, 2021
734d429
Move ProcessModel to package bisq.core.trade.protocol.bisq_v1.model
chimp1984 Oct 19, 2021
dca0c93
Cleanups
chimp1984 Oct 20, 2021
e752965
Add linebreak in error popup
chimp1984 Oct 20, 2021
9f3034e
Fix layout/text issues
chimp1984 Oct 20, 2021
dc82fba
Increase visibility
chimp1984 Oct 20, 2021
8768345
Remove Inject annotation at abstract classes
chimp1984 Oct 20, 2021
d1d1706
Add delegate methods to offer
chimp1984 Oct 20, 2021
dfbc746
Move Offer.Direction one level up and rename to OfferDirection
chimp1984 Oct 20, 2021
6cf0a7c
Rename paymentMethod.isAsset to paymentMethod.isBlockchain
chimp1984 Oct 20, 2021
dad19ba
Add isFiat and isAltcoin methods.
chimp1984 Oct 20, 2021
88198be
Rename availableConfirmedBalance to availableBalance
chimp1984 Oct 20, 2021
d4bb026
Only check for localhost btc node if mainnet
chimp1984 Oct 20, 2021
f8751a8
Make TxConfidenceListener and its onTransactionConfidenceChanged meth…
chimp1984 Oct 20, 2021
a927bea
Add scriptTypeId to RawTransactionInput
chimp1984 Oct 20, 2021
75072eb
Add deprecated annotation, null checks and comment to getRawInputFrom…
chimp1984 Oct 20, 2021
561ebe9
Move test classes into bisq.desktop.main.offer.bisq_v1.createoffer
chimp1984 Oct 20, 2021
8ee2554
Merge branch 'bsq-swap-low-risk-refactorings' into wip-merge2
chimp1984 Oct 20, 2021
559bc58
Fix merge issues
chimp1984 Oct 20, 2021
34c4eef
Add allowSpendMyOwnUnconfirmedTxOutputs flag to BsqCoinSelector
chimp1984 Oct 20, 2021
4757288
Add isMine method. Add error logs
chimp1984 Oct 20, 2021
0f6364d
Inline TransactionWitness
chimp1984 Oct 20, 2021
e582ffd
Add new methods
chimp1984 Oct 20, 2021
54e81d1
Add signTx and verifyNonDustTxo methods
chimp1984 Oct 20, 2021
5f8bc83
Remove unused signTx method
chimp1984 Oct 20, 2021
d95356b
Add verifiedBalance field.
chimp1984 Oct 20, 2021
cfc404b
Rename signTx to signTxAndVerifyNoDustOutputs (no code change)
chimp1984 Oct 20, 2021
82c1be1
Change log level
chimp1984 Oct 20, 2021
c15fc0c
Add comment, cleanups
chimp1984 Oct 20, 2021
d7f1b00
Rename processModel.getTradingPeer to getTradePeer
chimp1984 Oct 20, 2021
02d7dfd
Only print stack trace if dev mode
chimp1984 Oct 20, 2021
9e4be13
Change log level
chimp1984 Oct 20, 2021
8d25798
Replace Value annotation with Getter and EqualsAndHashCode
chimp1984 Oct 20, 2021
d976f11
Add methods
chimp1984 Oct 20, 2021
a3b3d56
Simplify
chimp1984 Oct 20, 2021
9d10646
Move getRandomOfferId method to OfferUtil
chimp1984 Oct 20, 2021
e061d6a
Replace Value with Getter
chimp1984 Oct 20, 2021
5b0e9ab
Rename trade.getPhase to getTradePhase
chimp1984 Oct 20, 2021
544dd89
Rename trade.getState to getTradeState
chimp1984 Oct 20, 2021
12fff54
Cleanup
chimp1984 Oct 20, 2021
2440d72
Extract methods, Cleanups
chimp1984 Oct 20, 2021
4cb0746
Extract methods, cleanups. Rename methods and vars
chimp1984 Oct 20, 2021
7211f89
Add exclude fields to EqualsAndHashCode
chimp1984 Oct 20, 2021
07883e9
Rename trade.getPhase to getTradePhase
chimp1984 Oct 20, 2021
0148a36
Extract to method in TradeUtil
chimp1984 Oct 20, 2021
1051640
Use early return. cleanup
chimp1984 Oct 20, 2021
8219bf8
Extract method. Rename vars
chimp1984 Oct 20, 2021
ee374c3
Cleanups, apply rename of getTradePhase
chimp1984 Oct 20, 2021
e940f6f
Add method. Dont return null in case of no amount but min fee
chimp1984 Oct 21, 2021
19aabba
Add method. cleanups
chimp1984 Oct 21, 2021
1c0b52c
Move OfferDirection from bisq.core.offer.bisq_v1 to bisq.core.offer
chimp1984 Oct 21, 2021
0735419
Remove handling of BundleOfEnvelopes in send method.
chimp1984 Oct 21, 2021
b80b6ec
Cleanups
chimp1984 Oct 21, 2021
23af455
Add filterPredicate
chimp1984 Oct 21, 2021
2e384ed
Make onDeleteAccount more clear
chimp1984 Oct 21, 2021
9d8c705
Only add delay if not devmode
chimp1984 Oct 21, 2021
d285157
Reduce visibility
chimp1984 Oct 21, 2021
8bb42e1
Add methods, move field up
chimp1984 Oct 21, 2021
1aa5e70
Add method
chimp1984 Oct 21, 2021
8ac40a3
Add style
chimp1984 Oct 21, 2021
c60df6e
Add linebreak (no code change)
chimp1984 Oct 21, 2021
9fb6a6c
Add isNotPublished method (will be combined later with bsq swap checks)
chimp1984 Oct 21, 2021
cfae096
Add null checks, extract variables, cleanups
chimp1984 Oct 21, 2021
2ae1860
Move tests to package bisq.desktop.main.offer.bisq_v1.createoffer
chimp1984 Oct 21, 2021
080dc3e
Merge branch 'chimp-bsq-swap' into wip-merge021.10
chimp1984 Oct 21, 2021
ab6e4e1
Dummy commit to enforce rebuild at CI
chimp1984 Oct 21, 2021
5412f8b
Merge branch 'chimp-bsq-swap' into bsq-swap-low-risk-refactorings
chimp1984 Oct 21, 2021
c920da3
Add abstract classes and interfaces. Let ProcessModel and TradingPeer…
chimp1984 Oct 21, 2021
8cd85a7
Let Trade extend TradeModel
chimp1984 Oct 21, 2021
dcd0101
Generify TradeResultHandler
chimp1984 Oct 21, 2021
5d687bd
Use TradeModel and ProtocolModel in TradeTaskRunner, TradeTask, Trade…
chimp1984 Oct 21, 2021
308bb68
Use TradeModel
chimp1984 Oct 21, 2021
453229e
Impl. onAckMessage. Add fields for concrete types
chimp1984 Oct 21, 2021
c0e70b8
Use TradeModel in trade domain
chimp1984 Oct 21, 2021
d063aff
Let OfferPayload extend OfferPayloadBase
chimp1984 Oct 21, 2021
b194960
Use TradeModel instead of Trade where appropriate.
chimp1984 Oct 21, 2021
14765d6
Move protobuf OfferPayload.Direction to OfferDirection
chimp1984 Oct 21, 2021
611b944
Move protobuf OfferPayload.Direction to OfferDirection
chimp1984 Oct 21, 2021
2f40edd
Use bitcoinj 42bbae9 (with fix required for bsq swaps)
chimp1984 Oct 21, 2021
63c385b
Add support for RemoveDataMessage in testCapability
chimp1984 Oct 21, 2021
54f17b0
Cleanups
chimp1984 Oct 21, 2021
ebfd1b5
Remove todo
chimp1984 Oct 21, 2021
9c56202
Add BSQ swap code
chimp1984 Oct 21, 2021
559491e
Merge branch 'master_upstream' into chimp-bsq-swap
chimp1984 Oct 21, 2021
cff719b
Merge branch 'chimp-bsq-swap' into bsq-swap-low-risk-refactorings
chimp1984 Oct 21, 2021
3558d01
Merge branch 'bsq-swap-low-risk-refactorings' into bsq-swap-impl
chimp1984 Oct 21, 2021
6d9d0f7
Apply codacy review suggestions
chimp1984 Oct 21, 2021
fdfb029
Move Utilities.objectToJson to JsonUtil.objectToJson
chimp1984 Oct 23, 2021
4ab1ee3
Add custom json serializer for OfferPayload
chimp1984 Oct 23, 2021
348bf3b
Update text
chimp1984 Oct 23, 2021
238a7dc
Remove missingFundsListener after successful take offer
chimp1984 Oct 23, 2021
b393968
Change log level
chimp1984 Oct 23, 2021
a77d65b
Improve BSQ swap offer details window
chimp1984 Oct 23, 2021
7dfb261
Update dev mode values for create offer
chimp1984 Oct 23, 2021
c86801f
Workaround for weird JFXComboBox bug
chimp1984 Oct 23, 2021
395d939
Add default value if no filter is available
chimp1984 Oct 23, 2021
f970f09
Add log
chimp1984 Oct 23, 2021
904fa07
Reset address entry if BSQ swap offer is used for create offer
chimp1984 Oct 23, 2021
0662fa7
Use checkNotNull and checkArgument for checking pre conditions
chimp1984 Oct 23, 2021
7c389e3
Add requestPersistence call.
chimp1984 Oct 23, 2021
ecdda10
Improve naming, comments, extract variables
chimp1984 Oct 23, 2021
b9756de
Improve naming, comments, extract variables, inline method
chimp1984 Oct 23, 2021
b92044b
Remove redundant complete call
chimp1984 Oct 23, 2021
89e7b64
Improve naming, cleanups, use static imports
chimp1984 Oct 23, 2021
d30c943
Fix linebreak
chimp1984 Oct 23, 2021
1ef21ac
Add useDaoMonitor field to PreferencesPayload
chimp1984 Oct 24, 2021
593bc34
Remove DaoEventCoordinator
chimp1984 Oct 24, 2021
35be6a1
Only call `daoStateMonitoringService.createHashFromBlock(block);`
chimp1984 Oct 24, 2021
71cc121
If dao state chain is not connecting (e.g. user had deactivated it
chimp1984 Oct 24, 2021
72184d6
Add toggle to dao monitor view to deactivate monitoring
chimp1984 Oct 24, 2021
d54d43f
Add toggle to PreferencesView
chimp1984 Oct 24, 2021
50d69e1
Fix text
chimp1984 Oct 24, 2021
85e864a
Fix text handling
chimp1984 Oct 24, 2021
463722e
Set useDaoMonitor in preferences to true for seed nodes.
chimp1984 Oct 24, 2021
b8290a7
Do not handle state hash messages if not activated
chimp1984 Oct 24, 2021
79ced07
Create snapshot after parsing done if dao monitor is deactivated
chimp1984 Oct 25, 2021
296c917
Don't check utxos during sync
chimp1984 Oct 25, 2021
5dcbb90
Move DaoStateMonitorView specific fields from
chimp1984 Oct 25, 2021
9b04889
Remove prevHash from StateHash classes.
chimp1984 Oct 25, 2021
965f526
Add isSelfConstructed to DaoStateHash (and remove it from
chimp1984 Oct 25, 2021
d97449a
Create daoStateBlocks from peers data in case we have daoMonitor deac…
chimp1984 Oct 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -170,6 +170,8 @@ public void start() {
@Override
public void onParseBlockChainComplete() {
parseBlockChainComplete = true;
daoStateService.getLastBlock().ifPresent(this::checkUtxos);

if (!preferences.isUseDaoMonitor()) {
return;
}
Expand All @@ -193,16 +195,9 @@ public void onParseBlockChainComplete() {

@Override
public void onDaoStateChanged(Block block) {
long genesisTotalSupply = daoStateService.getGenesisTotalSupply().value;
long compensationIssuance = daoStateService.getTotalIssuedAmount(IssuanceType.COMPENSATION);
long reimbursementIssuance = daoStateService.getTotalIssuedAmount(IssuanceType.REIMBURSEMENT);
long totalAmountOfBurntBsq = daoStateService.getTotalAmountOfBurntBsq();
// confiscated funds are still in the utxo set
long sumUtxo = daoStateService.getUnspentTxOutputMap().values().stream().mapToLong(BaseTxOutput::getValue).sum();
long sumBsq = genesisTotalSupply + compensationIssuance + reimbursementIssuance - totalAmountOfBurntBsq;

if (sumBsq != sumUtxo) {
utxoMismatches.add(new UtxoMismatch(block.getHeight(), sumUtxo, sumBsq));
// During syncing we do not call checkUtxos as its a bit slow (about 4 ms)
if (parseBlockChainComplete) {
checkUtxos(block);
}
}

Expand Down Expand Up @@ -409,6 +404,20 @@ else if (this.isInConflictWithNonSeedNode)
return changed.get();
}

private void checkUtxos(Block block) {
long genesisTotalSupply = daoStateService.getGenesisTotalSupply().value;
long compensationIssuance = daoStateService.getTotalIssuedAmount(IssuanceType.COMPENSATION);
long reimbursementIssuance = daoStateService.getTotalIssuedAmount(IssuanceType.REIMBURSEMENT);
long totalAmountOfBurntBsq = daoStateService.getTotalAmountOfBurntBsq();
// confiscated funds are still in the utxo set
long sumUtxo = daoStateService.getUnspentTxOutputMap().values().stream().mapToLong(BaseTxOutput::getValue).sum();
long sumBsq = genesisTotalSupply + compensationIssuance + reimbursementIssuance - totalAmountOfBurntBsq;

if (sumBsq != sumUtxo) {
utxoMismatches.add(new UtxoMismatch(block.getHeight(), sumUtxo, sumBsq));
}
}

private void verifyCheckpoints() {
// Checkpoint
checkpoints.forEach(checkpoint -> daoStateHashChain.stream()
Expand Down
Expand Up @@ -68,6 +68,7 @@ public class DaoStateSnapshotService implements DaoSetupService, DaoStateListene
@Nullable
private Runnable daoRequiresRestartHandler;
private boolean requestPersistenceCalled;
private boolean isParseBlockChainComplete;


///////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -116,7 +117,35 @@ public void onDaoStateChanged(Block block) {
// We need to execute first the daoStateMonitoringService.createHashFromBlock to get the hash created
daoStateMonitoringService.createHashFromBlock(block);
}
maybeCreateSnapshot(block);

// We only call maybeCreateSnapshot if we are done with parsing or if we have dao monitoring activated.
// In that case parsing is anyway slow and we prefer to have at each snapshot height a snapshot. It does not
// make syncing much slower by that.
if (preferences.isUseDaoMonitor() || isParseBlockChainComplete) {
maybeCreateSnapshot(block);
}
}

@Override
public void onParseBlockChainComplete() {
isParseBlockChainComplete = true;

// In case we have dao monitoring deactivated we create the snapshot after we are completed with parsing.
if (!preferences.isUseDaoMonitor()) {
// We use a thread to avoid that cloning slows down user thread.
new Thread(() -> {
Thread.currentThread().setName("Create-snapshot-after-parseBlockChainComplete");
long ts = System.currentTimeMillis();
daoStateSnapshotCandidate = daoStateService.getClone();
daoStateHashChainSnapshotCandidate = new LinkedList<>(daoStateMonitoringService.getDaoStateHashChain());
daoStateStorageService.requestPersistence(daoStateSnapshotCandidate,
daoStateHashChainSnapshotCandidate,
() -> {
log.info("Persisted daoState after parsing completed at height {}. Took {} ms",
daoStateService.getChainHeight(), System.currentTimeMillis() - ts);
});
}).start();
}
}


Expand Down