[bisq-network/bisq] Add local Bitcoin node configuration detection (#3982)

dmos62 notifications at github.com
Tue Feb 25 10:56:41 UTC 2020


I have two major changes in the works that could be merged in this PR. Related to #4005.

My initial approach was to make the bare minimum of changes to get these features, and I ignored a gut feeling that more profound changes could be useful. While thinking about #4005, I came full circle, and decided I'd like to change the following:

- set `LocalBitcoinNode` to trigger the checks automatically when it is queried for the first time;
- create a `LocalBitcoinNode::willUse` query method that would centralize logic that decides whether or not to use the local BTC node.

### Automatic triggering of checks

In my opinion, automatic triggering of checks is essential, as illustrated by #4005. We don't have a compile time assurance that there won't be inappropriate usages of LocalBitcoinNode (which currently requires the checks to be triggered before it can tell you anything about a locally running BTC node). My suggestion is to solve this by having the first query trigger the check.

### New query method `willUse`

`willUse` is clean up of equivalent logic that is littered throughout the codebase. The problem here is that we currently only centralize the questions "is there a local BTC node" and "is it usable/configured", but the codebase has to answer other related questions. Below I enumerate all related (implicit) questions: 

- "is there a local BTC node" in `NetworkSettingsView`;
- "should a usable local BTC node be ignored" in `BisqSetup` and `WalletConfig`;
- "are we going to use (are we using) a local BTC node" in `WalletSetup`, `Preferences`, `MainViewModel` and `NetworkSettingsView`.

These questions are all answered by combining `LocalBitcoinNode::isUsable` with inline logic. It results in code that is difficult to maintain and to read.

A `LocalBitcoinNode::willUse`, together with the already provided `isDetected` and `isUsable`, will cover all these cases, and will declutter local Bitcoin node related logic.

### Note

These two changes don't depend on each other.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3982#issuecomment-590808700
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200225/737c78f6/attachment.html>


More information about the bisq-github mailing list