Skip to content

Fix many bugs from Core 18 updates - #176

Merged
HashEngineering merged 9 commits into
masterfrom
bugfix-core-18
Sep 19, 2022
Merged

HashEngineering merged 9 commits into
masterfrom
bugfix-core-18

Conversation

@HashEngineering

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

* replace toPath with getAbsolutePath

Signed-off-by: HashEngineering <[email protected]>
* try to find another download peer first
* report error if no peers found

Signed-off-by: HashEngineering <[email protected]>
@HashEngineering HashEngineering self-assigned this Sep 13, 2022
Comment on lines +204 to +208
if (peer != null) {
peer.sendMessage(lastRequest.getRequestMessage());
} else {
log.info("no peer supplied to retry the last update request: {}", lastRequest.request);
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were getting an NPE if peer was null. Not sure of the implications of doing this fix, but other changes should have a null peer if the DashJ has been completely disconnected from the network. The sync process should resume when reconnecting.

Comment on lines +720 to +722
if (isLocked) {
context.peerGroup.getLock().unlock();
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a crash due to tryLock failing above.

if (executor.isShutdown())
return;
log.info("Saving manager file: {}", file.toPath());
log.info("Saving manager file: {}", file.getAbsolutePath());

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toPath() is not available on Android 6 or 7. getAbsolutePath() is used in many other places in DashJ.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should have been building DashJ for Java 7 to avoid some of these types of errors.

@codecov-commenter

codecov-commenter commented Sep 13, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #176 (15dfc54) into master (2338db3) will decrease coverage by 0.02%.
The diff coverage is 17.64%.

@@             Coverage Diff              @@
##             master     #176      +/-   ##
============================================
- Coverage     45.11%   45.09%   -0.03%     
+ Complexity     5330     5328       -2     
============================================
  Files           379      379              
  Lines         41492    41502      +10     
  Branches       5681     5685       +4     
============================================
- Hits          18719    18714       -5     
- Misses        20821    20834      +13     
- Partials       1952     1954       +2     
Impacted Files Coverage Δ
...c/main/java/org/bitcoinj/core/AbstractManager.java 55.33% <0.00%> (-0.55%) ⬇️
...rc/main/java/org/bitcoinj/core/VersionMessage.java 59.23% <ø> (ø)
...va/org/bitcoinj/evolution/AbstractQuorumState.java 26.28% <0.00%> (-0.33%) ⬇️
...c/main/java/org/bitcoinj/params/MainNetParams.java 80.83% <ø> (ø)
core/src/main/java/org/bitcoinj/wallet/Protos.java 30.93% <ø> (ø)
.../main/java/org/bitcoinj/evolution/QuorumState.java 46.98% <25.00%> (-0.55%) ⬇️
...main/java/org/bitcoinj/core/NetworkParameters.java 70.52% <100.00%> (ø)
...c/main/java/org/bitcoinj/manager/ManagerFiles.java 81.25% <100.00%> (ø)
.../main/java/org/bitcoinj/net/ConnectionHandler.java 68.42% <0.00%> (-2.64%) ⬇️
...e/src/main/java/org/bitcoinj/core/BloomFilter.java 73.97% <0.00%> (-2.06%) ⬇️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines +16534 to +16537
* <pre>
* Not used for wallet
* </pre>
*

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protos.java is a generated file from wallet.proto. One could ask why we include it in the repo. In bitcoinj it was removed from the repo (since it was autogenerated), but then those developers decided to add it back.

Comment on lines -310 to +312
shutdownAutosaveAndWait();
if (vFileManager != null) {
shutdownAutosaveAndWait();
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be called more than once in Dash Wallet and then shutdownAutosaveAndWait would throw an exception.

* prevent connection to 0.17.x.x nodes

Signed-off-by: HashEngineering <[email protected]>
* update nodes_main.txt using Dash Core 18.0.1 list

Signed-off-by: HashEngineering <[email protected]>

@Syn-McJ Syn-McJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@HashEngineering
HashEngineering merged commit 15dfc54 into master Sep 19, 2022
@HashEngineering
HashEngineering deleted the bugfix-core-18 branch October 7, 2022 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants