Comments (1)
diff --git a/config.go b/config.go
index 29ed421..2948267 100644
--- a/config.go
+++ b/config.go
@@ -58,6 +58,20 @@ type config struct {
ProxyPass string `long:"proxypass" default-mask:"-" description:"Password for proxy server"`
}
+// cleanAndExpandPath expands environement variables and leading ~ in the
+// passed path, cleans the result, and returns it.
+func cleanAndExpandPath(path string) string {
+ // Expand initial ~ to OS specific home directory.
+ if strings.HasPrefix(path, "~") {
+ homeDir := filepath.Dir(btcwalletHomeDir)
+ path = strings.Replace(path, "~", homeDir, 1)
+ }
+
+ // NOTE: The os.ExpandEnv doesn't work with Windows-style %VARIABLE%,
+ // but they variables can still be expanded via POSIX-style $VARIABLE.
+ return filepath.Clean(os.ExpandEnv(path))
+}
+
// updateConfigWithActiveParams update the passed config with parameters
// from the active net params if the relevant options in the passed config
// object are the default so options specified by the user on the command line
@@ -182,6 +196,8 @@ func loadConfig() (*config, []string, error) {
// Add default port to connect flag if missing.
cfg.Connect = normalizeAddress(cfg.Connect, activeNetParams.btcdPort)
+ cfg.CAFile = cleanAndExpandPath(cfg.CAFile)
+
return &cfg, remainingArgs, nil
}
from btcwallet.
Related Issues (20)
- -25: TX rejected: failed to validate input 11290e0....:0 which references output cf....a015ea68, prev output script bytes 76a91....8ac) HOT 7
- -25: TX rejected: failed to validate input c26....:0 which references output 37....:0 - OP_EQUALVERIFY failed (input witness [], input script bytes 473..., prev output script bytes 76a914...) HOT 2
- Ask for advice about using multiple utxos for the transaction HOT 2
- Non-witness inputs cannot have a witness HOT 5
- Ask for example for simple P2TR transaction HOT 8
- "error": "address manager is locked" HOT 4
- Bech32 (P2WPKH
- listaccounts only checks balances for KeyScopeBIP0044 addresses
- Allow setting the start block for address rescans HOT 4
- NIT: Bitcoin 0.25 changed the error text so our matching fails now and spams the logs. HOT 1
- Improvements for the chain package and the especially the pruned block fetcher. HOT 1
- GetDustThreshold does not take into account taproot HOT 2
- Add Wallet Use Case
- waddrmgr scope incorrect,Possible non-compliance with BIP HOT 4
- How should I use the wallet after I start btcwallet [-4: blockchain RPC is inactive]
- Test
- config: allow changing the default root directory
- Thank u I was scared didn't know what's happen @ wbtc network
- how to sign a P2WSH script? HOT 1
- spend a taproot script-path input owned by the wallet HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btcwallet.