mirror of
https://github.com/bisq-network/bisq.git
synced 2025-01-19 05:44:05 +01:00
A decentralized bitcoin exchange network
97ef9c1308
Use a crude Bloom filter (of sorts) to cut down the quadratic number of calls to 'TransactionAwareTradable.isRelatedToTransaction' (that is, one for each tx-tradable pair) during the Transactions view load. In this way, we may reduce the number of calls roughly 40-fold, for a Bisq instance with similar numbers of BSQ swap trades and escrow trades. (Sadly, profiling does not show a 40-fold reduction in the size of the 'isRelatedToTransaction' hotspot, likely due to the remaining calls being expensive ones involving disputed trades or unusual txs with nonzero locktime, e.g. dust attacks or funds from Electrum wallets.) To this end, partition the wallet transactions into 64 pseudo-randomly chosen buckets (with a dedicated bucket for txs which might be delayed payouts, namely those with nonzero locktime). Add an interface method, 'TransactionAwareTradable.getRelatedTransactionFilter', which returns an IntStream of all the indices of buckets where a related tx may plausibly be found. Where this is unclear, e.g. for trades involved in a dispute, just return everything (that is, the range 0..63 inclusive). Add a class, 'RelatedTransactionFilterSlices', that holds a provided list of TransactionAwareTradable instances and 64 bitsets of all the slices through their respective filters (each realised as 64-bit word instead of a streams of integers). In this way, a list of tradables plausibly related to any given tx may be quickly found by simply selecting the appropriate bitset of the 64 (by the tx bucket index). |
||
---|---|---|
.github | ||
.idea | ||
apitest | ||
assets | ||
build-logic | ||
cli | ||
common | ||
core | ||
daemon | ||
desktop | ||
docs | ||
gradle | ||
p2p | ||
proto | ||
scripts | ||
seednode | ||
statsnode | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.travis.yml | ||
build.gradle | ||
CODEOWNERS | ||
CONTRIBUTING.md | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
LICENSE | ||
Makefile | ||
pull_request_template.md | ||
README.md | ||
settings.gradle |
What is Bisq?
Bisq is a safe, private and decentralized way to exchange bitcoin for national currencies and other digital assets. Bisq uses peer-to-peer networking and multi-signature escrow to facilitate trading without a third party. Bisq is non-custodial and incorporates a human arbitration system to resolve disputes.
To learn more, see the doc and video at https://bisq.network/intro.
Get started using Bisq
Follow the step-by-step instructions at https://bisq.network/get-started.
Contribute to Bisq
See CONTRIBUTING.md and the developer docs.