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

fix: make sure non-descriptor wallet is created #58

Merged
merged 1 commit into from
Aug 26, 2022
Merged
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
21 changes: 19 additions & 2 deletions standalone/jam-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,28 @@ if [ "${ENSURE_WALLET}" = "true" ]; then
wallet_name="${jmenv['rpc_wallet_file']}"

echo "Creating wallet $wallet_name if missing..."
create_payload="{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"createwallet\",\"params\":[\"${wallet_name}\"]}"
create_payload="{\
\"jsonrpc\":\"2.0\",\
\"id\":\"curl\",\
\"method\":\"createwallet\",\
\"params\":{\
\"wallet_name\":\"${wallet_name}\",\
\"descriptors\":false,\
\"load_on_startup\":true\
}\
}"
curl --silent --user "${btcuser}" --data-binary "${create_payload}" "${btchost}" > /dev/null || true

echo "Loading wallet $wallet_name..."
load_payload="{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"loadwallet\",\"params\":[\"${wallet_name}\"]}"
load_payload="{\
\"jsonrpc\":\"2.0\",\
\"id\":\"curl\",\
\"method\":\"loadwallet\",\
\"params\":{\
\"filename\":\"${wallet_name}\",\
\"load_on_startup\":true\
}\
}"
curl --silent --user "${btcuser}" --data-binary "${load_payload}" "${btchost}" > /dev/null || true
fi

Expand Down