Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC-API: read gaplimit from config #1525

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions jmclient/jmclient/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ def jm_single() -> AttributeDict:
# but don't forget to bump your miner fees!
merge_algorithm = default

# Used currently by the RPC to modify the gap limit
# for address searching during wallet sync. Command line
# scripts can use the command line flag `-g` instead.
gaplimit = 6

# The fee estimate is based on a projection of how many sats/kilo-vbyte
# are needed to get in one of the next N blocks. N is set here as
# the value of 'tx_fees'. This cost estimate is high if you set
Expand Down Expand Up @@ -509,8 +514,6 @@ def jm_single() -> AttributeDict:
# [fraction, 0-1] / variance around all offer sizes. Ex: 500k minsize, 0.1 var = 450k-550k
size_factor = 0.1

gaplimit = 6

[SNICKER]
# Any other value than 'true' will be treated as False,
# and no SNICKER actions will be enabled in that case:
Expand Down
3 changes: 2 additions & 1 deletion jmclient/jmclient/wallet_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@ def unlockwallet(self, request, walletname):
wallet = open_test_wallet_maybe(
wallet_path, walletname, 4,
password=password.encode("utf-8"),
ask_for_password=False)
ask_for_password=False,
gap_limit = jm_single().config.getint("POLICY", "gaplimit"))
except StoragePasswordError:
raise NotAuthorized()
except RetryableStorageError:
Expand Down
3 changes: 2 additions & 1 deletion jmclient/jmclient/wallet_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,8 @@ def create_wallet(path, password, max_mixdepth, wallet_cls, **kwargs):
wallet_cls.initialize(storage, get_network(), max_mixdepth=max_mixdepth,
**kwargs)
storage.save()
return wallet_cls(storage)
return wallet_cls(storage,
gap_limit=jm_single().config.getint("POLICY", "gaplimit"))


def open_test_wallet_maybe(path, seed, max_mixdepth,
Expand Down