set wallet max_gap after sync

This commit is contained in:
Victor Shyba 2018-10-09 22:39:29 -03:00 committed by Lex Berezhny
parent 72ce0cd0b0
commit fc41af5889
2 changed files with 8 additions and 0 deletions

View file

@ -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})

View file

@ -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):