Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
780a384
feat: coinjoin integration draft
Syn-McJ Jan 4, 2024
56b2015
Merge pull request #525 from Syn-McJ/feat/coinjoin-base-classes
Syn-McJ Jan 9, 2024
ed43497
feat: callbacks for WalletEx
Syn-McJ Jan 16, 2024
161159d
chore: cleanup
Syn-McJ Jan 16, 2024
466f203
Merge pull request #526 from Syn-McJ/feat/coinjoin-wallet-ex-callbacks
Syn-McJ Jan 16, 2024
88bd849
feat: availableCoins & hasCollateralInputs methods
Syn-McJ Jan 25, 2024
2702712
Merge pull request #528 from Syn-McJ/feat/coinjoin-available-coins
Syn-McJ Jan 26, 2024
bc74776
feat: selectCoinsGroupedByAddresses Obj-C part and callbacks
Syn-McJ Feb 1, 2024
19a798c
Merge pull request #529 from Syn-McJ/feat/coinjoin-select-coins
Syn-McJ Feb 16, 2024
76df1f4
feat: create_denominated callbacks
Syn-McJ Feb 22, 2024
ff0ba82
Merge pull request #530 from Syn-McJ/feat/coinjoin-create-denominated
Syn-McJ Feb 22, 2024
5703274
feat: coinjoin derivation path and commit transaction
Syn-McJ Feb 27, 2024
181fce9
Merge pull request #531 from Syn-McJ/feat/coinjoin-commit-tx
Syn-McJ Feb 29, 2024
6b7056f
chore: refactor signtransaction without auth prompt
Syn-McJ Mar 3, 2024
1288411
feat: expose availableCoins to Rust
Syn-McJ Mar 7, 2024
e776c38
fix: white background
Syn-McJ Mar 7, 2024
af91ac6
Merge pull request #532 from Syn-McJ/feat/coinjoin-auto-denom
Syn-McJ Mar 7, 2024
30079d3
Merge branch 'develop' into feat/coinjoin-wait-utxos
Syn-McJ Mar 13, 2024
0999127
fix: wait for denom tx to be published before making collateral
Syn-McJ Mar 14, 2024
668bbbb
Merge pull request #535 from Syn-McJ/feat/coinjoin-wait-utxos
Syn-McJ Mar 14, 2024
4c11654
feat: CoinJoinClientManager callbacks
Syn-McJ Mar 28, 2024
8e4f8b0
Merge pull request #536 from Syn-McJ/feat/coinjoin-client-manager
Syn-McJ Mar 29, 2024
8fe3bab
chore: refactor code into CoinJoinManager
Syn-McJ Apr 8, 2024
bd9c95c
Merge pull request #537 from Syn-McJ/feat/coinjoin-manager
Syn-McJ Apr 9, 2024
5e65d71
feat: send accept message
Syn-McJ Apr 19, 2024
eecc368
chore: switching manager and wrapper
Syn-McJ Apr 22, 2024
62c4986
Merge pull request #538 from Syn-McJ/feat/coinjoin-send-message
Syn-McJ Apr 22, 2024
6daf3f9
fix: recalculate balance
Syn-McJ Apr 28, 2024
ebd7c4d
Merge branch 'feat/coinjoin' into feat/coinjoin-recalculate-balance
Syn-McJ Apr 28, 2024
9185e19
Merge pull request #541 from Syn-McJ/feat/coinjoin-recalculate-balance
Syn-McJ Apr 30, 2024
b5025f5
fix: get script from an actuall output if empty in initWithTransaction
Syn-McJ May 4, 2024
9709b9a
Merge pull request #542 from Syn-McJ/fix/coinjoin-sign-collateral
Syn-McJ May 7, 2024
46cd8b7
feat: sending DSA to a connected masternode
Syn-McJ May 7, 2024
4f4a9bf
Merge pull request #543 from Syn-McJ/feat/coinjoin-dsa
Syn-McJ May 8, 2024
49507d9
feat: senddsq & MasternodeGroup draft
Syn-McJ May 13, 2024
8377689
Merge pull request #544 from Syn-McJ/feat/coinjoin-senddsq
Syn-McJ May 16, 2024
a934f5c
feat: different message types support & disconnect logic for masterno…
Syn-McJ Jun 4, 2024
79bf495
Merge pull request #546 from Syn-McJ/feat/coinjoin-send-dsi
Syn-McJ Jun 4, 2024
25f0f93
feat: process dsq
Syn-McJ Jun 10, 2024
90a183e
chore: cleanup
Syn-McJ Jun 10, 2024
29fe732
fix: concurrent borrow issues
Syn-McJ Jun 13, 2024
9c22d40
Merge pull request #547 from Syn-McJ/feat/coinjoin-dsq
Syn-McJ Jun 13, 2024
caa81f8
feat: process dssu & dsc, masternode group logic
Syn-McJ Jun 18, 2024
158aadb
Merge pull request #548 from Syn-McJ/feat/coinjoin-dssu-dsc
Syn-McJ Jun 21, 2024
828e9da
feat: masternodegroup improvements
Syn-McJ Jun 21, 2024
c9cca9d
Merge branch 'feat/coinjoin' into feat/coinjoin-dstx
Syn-McJ Jun 21, 2024
fd47f05
feat: connected/disconnected
Syn-McJ Jun 21, 2024
63c38c5
Merge pull request #549 from Syn-McJ/feat/coinjoin-dstx
Syn-McJ Jun 27, 2024
772daee
feat: process dsf
Syn-McJ Jun 28, 2024
b5e42b5
feat: connectivity management
Syn-McJ Jul 2, 2024
ff080d8
fix: remove redundant synchronize
Syn-McJ Jul 2, 2024
544391d
Merge pull request #550 from Syn-McJ/feat/coinjoin-dsf
Syn-McJ Jul 2, 2024
4b4c6fd
fix: reorg and bug fixes
Syn-McJ Jul 11, 2024
c202e47
Merge pull request #552 from Syn-McJ/feat/coinjoin-messaging
Syn-McJ Jul 18, 2024
26834dd
fix: synchronization fixes
Syn-McJ Jul 23, 2024
79846e1
fix: reducing synchronizations
Syn-McJ Jul 28, 2024
d2f4a88
Merge pull request #554 from Syn-McJ/fix/coinjoin-issues
Syn-McJ Jul 30, 2024
dfd36b3
chore: logs
Syn-McJ Aug 4, 2024
f336045
fix: dsa & dsi sending
Syn-McJ Aug 6, 2024
13573d9
chore: cleanup
Syn-McJ Aug 6, 2024
c16bb8e
Merge branch 'develop' into fix/coinjoin-anyonecanpay
Syn-McJ Aug 9, 2024
3fb4013
fix: anyonecanpay & masternode group improvements
Syn-McJ Aug 13, 2024
d66de8f
Merge pull request #556 from Syn-McJ/feat/coinjoin-server
Syn-McJ Aug 13, 2024
4762b93
Merge pull request #558 from Syn-McJ/fix/coinjoin-anyonecanpay
Syn-McJ Aug 13, 2024
53b5344
chore: fixes
Syn-McJ Aug 19, 2024
e372154
fix: empty inputs for anyonecanpay
Syn-McJ Aug 20, 2024
a3adbc3
fix: signed inputs
Syn-McJ Aug 22, 2024
78044d7
feat: remove getIdentityIdsByKeyHashes and edit getIdentitiesByKeyHashes
pauldelucia Aug 23, 2024
b293048
fix: address dpns contract changes
pauldelucia Aug 24, 2024
76d6899
fix: change misspelling serivce to service
pauldelucia Aug 24, 2024
c4ec591
Merge pull request #559 from Syn-McJ/fix/coinjoin-anyonecanpay
Syn-McJ Aug 26, 2024
545c440
removed DAPIGRPC
QuantumExplorer Aug 26, 2024
7cf821f
feat: event listeners
Syn-McJ Aug 26, 2024
03f3d45
Merge pull request #561 from Syn-McJ/feat/coinjoin-events
Syn-McJ Aug 27, 2024
1784155
fix: multisession mixing & refresh unused keys
Syn-McJ Aug 29, 2024
f1bab5b
fix: skip registerAddressesWithGapLimit if addresses aren't loaded
Syn-McJ Aug 31, 2024
01e0c60
Merge branch 'fix/coinjoin-deriv-path' into fix/coinjoin-multisession
Syn-McJ Sep 1, 2024
0d5175a
chore: wallet integration changes
Syn-McJ Sep 4, 2024
91769f7
Merge pull request #562 from Syn-McJ/fix/coinjoin-multisession
Syn-McJ Sep 5, 2024
ff27ac1
Merge pull request #564 from Syn-McJ/fix/coinjoin-deriv-path
Syn-McJ Sep 5, 2024
3790d39
fix: coinjoin balance calculation
Syn-McJ Sep 6, 2024
732ba71
Merge branch 'fix/coinjoin-balance-calculations' into fix/coinjoin-send
Syn-McJ Sep 6, 2024
0d183ad
Merge pull request #565 from Syn-McJ/fix/coinjoin-balance-calculations
Syn-McJ Sep 7, 2024
f3835f9
fix: use DSCoinControl to only include selected inputs
Syn-McJ Sep 7, 2024
315879b
Merge branch 'fix/coinjoin-send' into feat/coinjoin-wallet-integration
Syn-McJ Sep 10, 2024
41f025d
fix: wallet integration fixes
Syn-McJ Sep 15, 2024
1b812f4
Merge pull request #566 from Syn-McJ/fix/coinjoin-send
Syn-McJ Sep 16, 2024
c43a04e
Merge pull request #567 from Syn-McJ/feat/coinjoin-wallet-integration
Syn-McJ Sep 16, 2024
49b001b
fix: simplify MasternodeGroup
Syn-McJ Sep 21, 2024
397c870
Merge pull request #568 from Syn-McJ/chore/coinjoin-connectivity-impr…
Syn-McJ Sep 24, 2024
f9e21b8
feat: coincontrol improvements
Syn-McJ Sep 27, 2024
f43c411
fix: MasternodeGroup crashes
Syn-McJ Sep 29, 2024
b865fe4
fix: change state to enabled when starting CoinJoin
Syn-McJ Sep 29, 2024
de6320d
fix: xcode 16 build
ogabrielides Oct 1, 2024
371128a
Merge pull request #571 from ogabrielides/xcode-16-fix
Syn-McJ Oct 2, 2024
16cf6b2
Merge pull request #570 from Syn-McJ/fix/coinjoin-mngroup-fixes
Syn-McJ Oct 2, 2024
b6db74b
fix: set from the caller to account for coinjoin being enabled, but …
Syn-McJ Oct 3, 2024
03698d4
fix: stuck syncing
Syn-McJ Oct 3, 2024
26e9aed
fix: take parameter from the caller
Syn-McJ Oct 7, 2024
40ddb7b
Merge pull request #573 from Syn-McJ/fix/coinjoin-send-anonymized
Syn-McJ Oct 7, 2024
c15ff1d
chore: reduce logs
Syn-McJ Oct 11, 2024
09eee81
fix: align derivation path limit gap with Android
Syn-McJ Oct 11, 2024
5527d76
fix: NPE at DSChainBlockWasLockedNotification and logs
Syn-McJ Oct 13, 2024
1b5af0d
fix: crash & logging fixes
Syn-McJ Oct 18, 2024
17c1a92
fix: NPE at DSChainBlockWasLockedNotification and logs
Syn-McJ Oct 13, 2024
8b8df3a
fix: crash & logging fixes
Syn-McJ Oct 18, 2024
c9d9c4f
Merge pull request #574 from Syn-McJ/feat/coinjoin-crash-fixes
Syn-McJ Oct 23, 2024
23ebb5c
Merge branch 'feat/coinjoin' into fix/coinjoin-gap-limit
Syn-McJ Oct 24, 2024
fad1b1a
chore: cleanup
Syn-McJ Oct 24, 2024
618d981
fix: report new blocks even if not started
Syn-McJ Oct 24, 2024
4d36bc2
fix: example build
Syn-McJ Oct 24, 2024
14de3ab
fix: incorrect polymorphism
pankcuf Oct 25, 2024
805290b
Merge pull request #576 from dashpay/fix/special-tx-hashing
Syn-McJ Oct 25, 2024
7f9026f
Merge branch 'feat/coinjoin' into fix/coinjoin-gap-limit
Syn-McJ Oct 25, 2024
e8143c3
fix: synchronization fixes
Syn-McJ Oct 26, 2024
668ca4c
fix: private logs & memory management
Syn-McJ Oct 30, 2024
e7a8ea0
Merge pull request #575 from Syn-McJ/fix/coinjoin-gap-limit
Syn-McJ Nov 4, 2024
de07238
Merge pull request #577 from Syn-McJ/fix/coinjoin-crashes
Syn-McJ Nov 4, 2024
343de62
Merge branch 'develop' into feat/coinjoin
Syn-McJ Nov 8, 2024
02f184c
fix: improve error mode detection
Syn-McJ Nov 15, 2024
6b74d4a
Merge branch 'develop' into feat/migrate-v0.22-to-v1.0-methods
pankcuf Nov 15, 2024
849ce95
Merge pull request #560 from dashpay/feat/migrate-v0.22-to-v1.0-methods
pankcuf Nov 15, 2024
0ad0a1c
Merge branch 'develop' into fix/coinjoin-error-mode
Syn-McJ Nov 18, 2024
895a56b
Revert "feat: migrations for Platform v0.22 to v1"
pankcuf Nov 18, 2024
629ca9d
Merge pull request #581 from dashpay/revert-560-feat/migrate-v0.22-to…
Syn-McJ Nov 23, 2024
adc69ac
Merge branch 'develop' into feat/coinjoin
Syn-McJ Nov 23, 2024
2a64061
Merge branch 'feat/coinjoin' into fix/coinjoin-error-mode
Syn-McJ Nov 23, 2024
68ccdd7
fix: adjust coinjoin gap limit when forming the bloom filter
Syn-McJ Nov 23, 2024
0edaa96
chore: add session status to logs
Syn-McJ Dec 4, 2024
e37280a
chore: cleanup
Syn-McJ Dec 4, 2024
a4e3242
Merge pull request #582 from Syn-McJ/fix/coinjoin-gap-limit
Syn-McJ Dec 10, 2024
54e7567
feat: compress logs
Syn-McJ Dec 13, 2024
0b17e79
Merge branch 'feat/coinjoin-zip-logs' into fix/coinjoin-cache-tx-info
Syn-McJ Dec 13, 2024
957a8e9
Merge pull request #583 from Syn-McJ/feat/coinjoin-zip-logs
Syn-McJ Dec 13, 2024
9b57d27
fix: cache dashAmount and direction in DSTransaction
Syn-McJ Dec 18, 2024
a064058
fix: sync fixes
Syn-McJ Dec 18, 2024
aebadbc
Merge pull request #584 from Syn-McJ/fix/coinjoin-cache-tx-info
Syn-McJ Dec 18, 2024
9e286c7
fix: asset lock payload
pankcuf Dec 19, 2024
dbf4a27
fix: add dest_change to coin control
Syn-McJ Dec 22, 2024
6c7a5d3
Merge pull request #585 from dashpay/fix/asset-lock-payload
Syn-McJ Dec 30, 2024
e62dcdb
Merge pull request #586 from Syn-McJ/feat/coinjoin-dest-change
Syn-McJ Jan 13, 2025
dfc86c6
fix: asset lock payload
pankcuf Dec 19, 2024
d92d814
fix: asset lock tx change
Syn-McJ Jan 21, 2025
3743e9a
Merge branch 'develop' into feat/coinjoin
Syn-McJ Jan 21, 2025
81cec50
Merge pull request #587 from dashpay/feat/coinjoin
Syn-McJ Jan 28, 2025
60ac6c2
fix: memory & lock issues in sortTransactions
Syn-McJ Jan 31, 2025
2090ec4
Merge branch 'fix/sort-transactions' into fix/coinjoin-double-spend
Syn-McJ Feb 2, 2025
fb036d9
fix: notify UI of double spent or unconfirmed tx
Syn-McJ Feb 6, 2025
c2c571e
fix: polymorphism in DSAssetLockTransaction
Syn-McJ Feb 11, 2025
160d7e0
Merge pull request #588 from dashpay/fix/sort-transactions
Syn-McJ Feb 11, 2025
51f1515
Merge pull request #589 from Syn-McJ/fix/coinjoin-double-spend
Syn-McJ Feb 11, 2025
d077de5
fix: polymorphism in DSAssetUnlockTransaction
Syn-McJ Feb 11, 2025
3445c8f
Merge branch 'develop' into fix/coinjoin-polymorphism
Syn-McJ Feb 12, 2025
ee94d4a
Merge pull request #590 from Syn-McJ/fix/coinjoin-polymorphism
Syn-McJ Feb 13, 2025
463eb05
fix: check for valid data in ecdsaKeyAddressFromPublicKeyData
Syn-McJ Feb 16, 2025
707eae9
fix: remove unnesesary synchronizations
Syn-McJ Feb 17, 2025
212b8a5
fix: process DSTX
Syn-McJ Feb 28, 2025
fd05825
feat: unlock coins from recently arrived mixing tx
Syn-McJ Feb 28, 2025
f2c0a1d
feat: coinjoin finishing mode
Syn-McJ Mar 4, 2025
b473d7e
Merge branch 'fix/coinjoin-polymorphism' into fix/coinjoin-finishing
Syn-McJ Mar 4, 2025
6ee715c
Merge branch 'fix/coinjoin-crashes' into fix/coinjoin-finishing
Syn-McJ Mar 4, 2025
c3ecb68
Merge pull request #591 from Syn-McJ/fix/coinjoin-crashes
Syn-McJ Mar 4, 2025
0f9b5dc
chore: restore and bump DashSharedCore version
Syn-McJ Mar 6, 2025
f2adb2f
chore: cleanup Example podfile
Syn-McJ Mar 6, 2025
b391188
Merge pull request #593 from Syn-McJ/fix/coinjoin-finishing
Syn-McJ Mar 12, 2025
a11fbef
fix: downgrade cocoapods for CI
Syn-McJ Mar 14, 2025
e1e27bd
chore: bump dash-shared-core version
Syn-McJ Mar 17, 2025
a2e7536
fix: DashSync build fix
Syn-McJ Mar 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
- name: Setup CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2
- name: Rustup add targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
- name: Build dependencies
Expand All @@ -59,4 +63,4 @@ jobs:
-scheme "DashSync-Example" \
-workspace "DashSync.xcworkspace" \
-destination "platform=$platform,name=iPhone 13" \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO
4 changes: 4 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ jobs:
${{ runner.os }}-pods-
- name: Rustup add targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
- name: Setup CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2
- name: Dependencies
working-directory: ./dashsync/Example
run: pod install --repo-update
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2eTestsTestnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
${{ runner.os }}-pods-
- name: Rustup add targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
- name: Setup CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2
- name: Dependencies
working-directory: ./dashsync/Example
run: pod install --repo-update
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ jobs:
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Setup CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2
- name: Rustup add targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
- name: Dependencies
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
run: cargo install cargo-lipo
- name: Rustup add targets
run: rustup target add x86_64-apple-darwin
- name: Setup CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2
- name: Build Dependencies
working-directory: ./dashsync/Example
run: pod install --repo-update
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/syncTestMainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
${{ runner.os }}-pods-
- name: Rustup add targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
- name: Setup CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2
- name: Dependencies
working-directory: ./dashsync/Example
run: pod install --repo-update
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/syncTestTestnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
${{ runner.os }}-pods-
- name: Rustup add targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
- name: Setup CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2
- name: Dependencies
working-directory: ./dashsync/Example
run: pod install --repo-update
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ jobs:
- name: Rustup add targets
run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim

- name: Setup CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2

- name: Dependencies
working-directory: ./dashsync/Example
run: pod install --repo-update
Expand Down
3 changes: 1 addition & 2 deletions DashSync.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Pod::Spec.new do |s|
s.ios.framework = 'UIKit'
s.macos.framework = 'Cocoa'
s.compiler_flags = '-Wno-comma'
s.dependency 'DashSharedCore', '0.4.19'
s.dependency 'DashSharedCore', '0.5.1'
s.dependency 'CocoaLumberjack', '3.7.2'
s.ios.dependency 'DWAlertController', '0.2.1'
s.dependency 'DSDynamicOptions', '0.1.2'
Expand All @@ -43,4 +43,3 @@ Pod::Spec.new do |s|
s.prefix_header_contents = '#import "DSEnvironment.h"'

end

4 changes: 3 additions & 1 deletion DashSync/shared/DashSync.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#import "DSPeerEntity+CoreDataClass.h"
#import "DSPeerManager+Protected.h"
#import "DSSyncState.h"
#import "DSCoinJoinManager.h"
#import "DSQuorumEntryEntity+CoreDataClass.h"
#import "DSQuorumSnapshotEntity+CoreDataClass.h"
#import "DSSporkManager+Protected.h"
Expand Down Expand Up @@ -122,13 +123,14 @@ - (void)startSyncForChain:(DSChain *)chain {
- (void)stopSyncAllChains {
NSArray *chains = [[DSChainsManager sharedInstance] chains];
for (DSChain *chain in chains) {
[[DSCoinJoinManager sharedInstanceForChain:chain] stop];
[[[DSChainsManager sharedInstance] chainManagerForChain:chain].peerManager disconnect: DSDisconnectReason_ChainWipe];
}
}

- (void)stopSyncForChain:(DSChain *)chain {
NSParameterAssert(chain);

[[DSCoinJoinManager sharedInstanceForChain:chain] stop];
[[[DSChainsManager sharedInstance] chainManagerForChain:chain] stopSync];
}

Expand Down
41 changes: 23 additions & 18 deletions DashSync/shared/Libraries/DSLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//

#import "DSLogger.h"
#import "CompressingLogFileManager.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -49,33 +50,37 @@ - (instancetype)init {
if (self) {
[DDLog addLogger:[DDOSLogger sharedInstance]]; // os_log

DDFileLogger *fileLogger = [[DDFileLogger alloc] init];
fileLogger.rollingFrequency = 60 * 60 * 24; // 24 hour rolling
fileLogger.logFileManager.maximumNumberOfLogFiles = 3; // keep a 3 days worth of log files
//[fileLogger setLogFormatter:[[NoTimestampLogFormatter alloc] init]]; // Use the custom formatter
unsigned long long maxFileSize = 1024 * 1024 * 5; // 5 MB max. Then log files are ziped
CompressingLogFileManager *logFileManager = [[CompressingLogFileManager alloc] initWithFileSize:maxFileSize];
DDFileLogger *fileLogger = [[DDFileLogger alloc] initWithLogFileManager:logFileManager];
fileLogger.rollingFrequency = 60 * 60 * 24; // 24 hour rolling
fileLogger.maximumFileSize = maxFileSize;
fileLogger.logFileManager.maximumNumberOfLogFiles = 10;

[DDLog addLogger:fileLogger];
_fileLogger = fileLogger;
}
return self;
}

- (NSArray<NSURL *> *)logFiles {
NSArray<DDLogFileInfo *> *logFileInfos = [self.fileLogger.logFileManager unsortedLogFileInfos];
NSMutableArray<NSURL *> *logFiles = [NSMutableArray array];
for (DDLogFileInfo *fileInfo in logFileInfos) {
NSURL *fileURL = [NSURL fileURLWithPath:fileInfo.filePath];
if (fileURL) {
[logFiles addObject:fileURL];
}
}
// add rust log file located at $CACHE/Logs/processor.log
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *cacheDirectory = [paths objectAtIndex:0];
NSString *rustLogPath = [cacheDirectory stringByAppendingPathComponent:@"Logs/processor.log"];
NSString *logsDirectory = [self.fileLogger.logFileManager logsDirectory];
NSArray *fileNames = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:logsDirectory error:nil];
NSMutableArray *logFiles = [NSMutableArray arrayWithCapacity:[fileNames count]];

if ([[NSFileManager defaultManager] fileExistsAtPath:rustLogPath]) {
[logFiles addObject:[NSURL fileURLWithPath:rustLogPath]];
for (NSString *fileName in fileNames) {
BOOL hasProperSuffix = [fileName hasSuffix:@".log"] || [fileName hasSuffix:@".gz"];

if (hasProperSuffix) {
NSString *filePath = [logsDirectory stringByAppendingPathComponent:fileName];
NSURL *fileURL = [NSURL fileURLWithPath:filePath];

if (fileURL) {
[logFiles addObject:fileURL];
}
}
}

return [logFiles copy];
}

Expand Down
20 changes: 20 additions & 0 deletions DashSync/shared/Libraries/Logs/CompressingLogFileManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// CompressingLogFileManager.h
// LogFileCompressor
//
// CocoaLumberjack Demos
//

#import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>

@interface CompressingLogFileManager : DDLogFileManagerDefault
{
BOOL upToDate;
BOOL isCompressing;
}

@property (nonatomic, assign) unsigned long long maxFileSize;
- (instancetype)initWithFileSize:(unsigned long long)maxFileSize;

@end
Loading
Loading