forked from LBRYCommunity/lbry-sdk
set wallet max_gap after sync
This commit is contained in:
parent
72ce0cd0b0
commit
fc41af5889
2 changed files with 8 additions and 0 deletions
|
@ -115,6 +115,13 @@ class Account(BaseAccount):
|
|||
indent=2
|
||||
))
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def save_max_gap(self):
|
||||
gap = yield self.get_max_gap()
|
||||
self.receiving.gap = max(20, gap['max_receiving_gap'] + 1)
|
||||
self.change.gap = max(6, gap['max_change_gap'] + 1)
|
||||
self.wallet.save()
|
||||
|
||||
def get_balance(self, confirmations=0, include_claims=False, **constraints):
|
||||
if not include_claims:
|
||||
constraints.update({'is_claim': 0, 'is_update': 0, 'is_support': 0})
|
||||
|
|
|
@ -83,6 +83,7 @@ class MainNetLedger(BaseLedger):
|
|||
yield defer.DeferredList([
|
||||
a.maybe_migrate_certificates() for a in self.accounts
|
||||
])
|
||||
yield defer.DeferredList([a.save_max_gap() for a in self.accounts])
|
||||
|
||||
|
||||
class TestNetLedger(MainNetLedger):
|
||||
|
|
Loading…
Reference in a new issue