summaryrefslogtreecommitdiff
path: root/btc-wire
diff options
context:
space:
mode:
authorAntoine A <>2022-02-17 00:23:21 +0100
committerAntoine A <>2022-02-17 00:23:21 +0100
commit0b51ecda47a222c02b66f65d2d55d104ecfab7e4 (patch)
tree4d4eb5cfdfcfca30aec27733ba2073a0c19ed17b /btc-wire
parent9efcd48600a6a6d999b372460f568ef7063a6d40 (diff)
downloaddepolymerization-0b51ecda47a222c02b66f65d2d55d104ecfab7e4.tar.gz
depolymerization-0b51ecda47a222c02b66f65d2d55d104ecfab7e4.tar.bz2
depolymerization-0b51ecda47a222c02b66f65d2d55d104ecfab7e4.zip
Fix PWD name conflict
Diffstat (limited to 'btc-wire')
-rw-r--r--btc-wire/src/config.rs8
-rw-r--r--btc-wire/src/main.rs4
-rw-r--r--btc-wire/src/rpc.rs8
3 files changed, 10 insertions, 10 deletions
diff --git a/btc-wire/src/config.rs b/btc-wire/src/config.rs
index 4560fcc..405960d 100644
--- a/btc-wire/src/config.rs
+++ b/btc-wire/src/config.rs
@@ -109,13 +109,13 @@ impl BitcoinConfig {
([127, 0, 0, 1], port).into()
};
- let auth = if let (Some(login), Some(pwd)) = (
+ let auth = if let (Some(login), Some(passwd)) = (
section.and_then(|s| s.get("rpcuser")),
section.and_then(|s| s.get("rpcpassword")),
) {
- BtcAuth::Auth(format!("{}:{}", login, pwd))
- } else if let (Some(login), Some(pwd)) = (main.get("rpcuser"), main.get("rpcpassword")) {
- BtcAuth::Auth(format!("{}:{}", login, pwd))
+ BtcAuth::Auth(format!("{}:{}", login, passwd))
+ } else if let (Some(login), Some(passwd)) = (main.get("rpcuser"), main.get("rpcpassword")) {
+ BtcAuth::Auth(format!("{}:{}", login, passwd))
} else {
BtcAuth::Cookie
};
diff --git a/btc-wire/src/main.rs b/btc-wire/src/main.rs
index 47c4297..d9a0675 100644
--- a/btc-wire/src/main.rs
+++ b/btc-wire/src/main.rs
@@ -128,8 +128,8 @@ fn init(config: Option<PathBuf>, init: Init) {
}
// Create wallet
- let pwd = password();
- let created = match rpc.create_wallet(WIRE_WALLET_NAME, &pwd) {
+ let passwd = password();
+ let created = match rpc.create_wallet(WIRE_WALLET_NAME, &passwd) {
Err(rpc::Error::RPC { code, .. }) if code == ErrorCode::RpcWalletError => false,
Err(e) => panic!("{}", e),
Ok(_) => true,
diff --git a/btc-wire/src/rpc.rs b/btc-wire/src/rpc.rs
index f15f43f..66ab359 100644
--- a/btc-wire/src/rpc.rs
+++ b/btc-wire/src/rpc.rs
@@ -232,13 +232,13 @@ impl Rpc {
}
/// Create encrypted native bitcoin wallet
- pub fn create_wallet(&mut self, name: &str, pwd: &str) -> Result<Wallet> {
- self.call("createwallet", &(name, (), (), pwd, (), true))
+ pub fn create_wallet(&mut self, name: &str, passwd: &str) -> Result<Wallet> {
+ self.call("createwallet", &(name, (), (), passwd, (), true))
}
- pub fn unlock_wallet(&mut self, pwd: &str) -> Result<()> {
+ pub fn unlock_wallet(&mut self, passwd: &str) -> Result<()> {
// TODO Capped at 3yrs, is it enough ?
- match self.call("walletpassphrase", &(pwd, 100000000)) {
+ match self.call("walletpassphrase", &(passwd, 100000000)) {
Err(Error::Null) => Ok(()),
i => i,
}