mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-09-02 18:25:16 +00:00
Release account reader lock before rescaning.
This commit is contained in:
parent
d2d278a9ee
commit
cec819a887
1 changed files with 2 additions and 2 deletions
|
@ -474,8 +474,8 @@ func (a *Account) Track() {
|
||||||
// main chain.
|
// main chain.
|
||||||
func (a *Account) RescanActiveAddresses() {
|
func (a *Account) RescanActiveAddresses() {
|
||||||
// Determine the block to begin the rescan from.
|
// Determine the block to begin the rescan from.
|
||||||
a.mtx.RLock()
|
|
||||||
beginBlock := int32(0)
|
beginBlock := int32(0)
|
||||||
|
a.mtx.RLock()
|
||||||
if a.fullRescan {
|
if a.fullRescan {
|
||||||
// Need to perform a complete rescan since the wallet creation
|
// Need to perform a complete rescan since the wallet creation
|
||||||
// block.
|
// block.
|
||||||
|
@ -493,10 +493,10 @@ func (a *Account) RescanActiveAddresses() {
|
||||||
// If we're synced with block x, must scan the blocks x+1 to best block.
|
// If we're synced with block x, must scan the blocks x+1 to best block.
|
||||||
beginBlock = bs.Height + 1
|
beginBlock = bs.Height + 1
|
||||||
}
|
}
|
||||||
|
a.mtx.RUnlock()
|
||||||
|
|
||||||
// Rescan active addresses starting at the determined block height.
|
// Rescan active addresses starting at the determined block height.
|
||||||
Rescan(CurrentRPCConn(), beginBlock, a.ActivePaymentAddresses())
|
Rescan(CurrentRPCConn(), beginBlock, a.ActivePaymentAddresses())
|
||||||
a.mtx.RUnlock()
|
|
||||||
a.writeDirtyToDisk()
|
a.writeDirtyToDisk()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue