wallet: Make scan / abort status private to CWallet#14942
wallet: Make scan / abort status private to CWallet#14942Empact wants to merge 3 commits intobitcoin:masterfrom
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
a71986a to
94accf9
Compare
|
Rebased and substantially refocused this PR to:
|
fd61c8b to
4cfd0a8
Compare
4cfd0a8 to
9d6a502
Compare
9d6a502 to
741f2fe
Compare
741f2fe to
4b4cf7c
Compare
|
Rebased |
|
looks like a nice refactor utACK 4b4cf7cc28347b2d537be89a412093dbd62ea83e |
4b4cf7c to
469117d
Compare
|
Rebased, and restored |
|
not sure why github tends to screw up range-diffs sometimes but here's the last one: 1: 99a72728a6 = 1: c82f6c7806 Return ScanResult from CWallet::RescanFromTime
2: 4b4cf7cc28 ! 2: 469117d55c Make scan / abort status private to CWallet
@@ -2,7 +2,7 @@
Make scan / abort status private to CWallet
- Drop CWallet::IsAbortingRescan and IsScanning by reporting the abort
+ Drop CWallet::IsAbortingRescan by reporting the abort
effectuality from CWallet::AbortScan.
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp
@@ -54,8 +54,7 @@
*/
- void AbortRescan() { fAbortRescan = true; }
- bool IsAbortingRescan() { return fAbortRescan; }
-- bool IsScanning() { return fScanningWallet; }
+ bool AbortRescan();
-
- /**
- * keystore implementation
+ bool IsScanning() { return fScanningWallet; }
+ int64_t ScanningDuration() const { return fScanningWallet ? GetTimeMillis() - m_scanning_start : 0; }
+ double ScanningProgress() const { return fScanningWallet ? (double) m_scanning_progress : 0; }re-utACK 469117d55c3601c75883d8ca7ff5e76f9f60da60 |
469117d to
c26c232
Compare
c26c232 to
319aeba
Compare
kallewoof
left a comment
There was a problem hiding this comment.
Looks like an improvement. Left comments.
src/wallet/wallet.h
Outdated
There was a problem hiding this comment.
This feels weird to me, and feels like it should have a new ORPHAN_CHAIN ScanResult, even if this is handled the same way as SUCCESS everywhere right now.
src/wallet/wallet.cpp
Outdated
There was a problem hiding this comment.
Looks like you could have a race in this method?
There was a problem hiding this comment.
It's a bit convoluted, but I think it's handled gracefully: if fScanningWallet is set to false as fAbortRescan is being set to true (i.e. at the end of a scan), there is no issue as ScanForWalletTransactions sets fAbortRescan to false at its start.
BTW this behavior is unchanged - here's the prior implementation: https://github.com/bitcoin/bitcoin/pull/14942/files#diff-522490d83dce5375d423b23886e4125eL217-R219
src/wallet/rpcdump.cpp
Outdated
There was a problem hiding this comment.
Why does it matter the return value? Isn't even documented.
Lookup the failed time just in the case it's needed.
Drop CWallet::IsAbortingRescan by reporting the abort effectuality from CWallet::AbortScan.
And move to the header.
319aeba to
71b9360
Compare
|
🐙 This pull request conflicts with the target branch and needs rebase. |
|
Any plans for this? It's needed rebase for more than a year, no other activity. |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
|
Closing for now due to inactivity for more than a year. Can be reopened anytime. Just leave a comment here or in IRC. |
By returning
ScanResultfromRescanFromTimeand reporting the effectuality ofAbortScan.And consolidate rpc-level error handling across
RescanFromTimeandScanForWalletTransactions.Note this changes the
rescanblockchainscan failure error fromRPC_MISC_ERRORtoRPC_WALLET_ERROR, which seems more appropriate and matches thebehavior from the rpcdump methods.
This follows up on #13076.