aboutsummaryrefslogtreecommitdiff
path: root/src/compat/stdin.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2019-10-02 18:36:01 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2019-10-02 18:37:14 +0200
commitf4a0d27e85754d60804ffa36e415b67c263180b9 (patch)
tree9889686ebab2cd3c5e0c3f00b84cdbddbd6a15c8 /src/compat/stdin.h
parentfecc1be23143476b981352e8516cf9cce0450d62 (diff)
parent50c4afa3c420f11329cffb091b62beeb96b39183 (diff)
downloadbitcoin-f4a0d27e85754d60804ffa36e415b67c263180b9.tar.xz
Merge #13716: bitcoin-cli: -stdinwalletpassphrase and non-echo stdin passwords
50c4afa3c420f11329cffb091b62beeb96b39183 add newline after -stdin* (Karl-Johan Alm) 7f11fba2e3c7b1e00ffb98504cdcfc2ded9c09cf cli: add -stdinwalletpassphrase for (slightly more) secure CLI (Karl-Johan Alm) 0da503e9475fea5644168544668581796bf66334 add stdin helpers for password input support (Karl-Johan Alm) Pull request description: This PR * adds `-stdinwalletpassphrase` for use with `walletpasshprase(change)` * adds no-echo for passwords (`-stdinrpcpass` and above) It may not be ideal, but it's better than having to clear the screen whenever you unlock the wallet. ACKs for top commit: laanwj: code review ACK 50c4afa3c420f11329cffb091b62beeb96b39183 Tree-SHA512: 473db8a303ff360ffaa36ac81a2f82be2136fa82696df0bc4f33cb44033a3ae258b5aa5bbcc1f101f88ae9abe9598ed564ce52877ab139bd5d709833f5275ec6
Diffstat (limited to 'src/compat/stdin.h')
-rw-r--r--src/compat/stdin.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/compat/stdin.h b/src/compat/stdin.h
new file mode 100644
index 0000000000..468fe4d6a6
--- /dev/null
+++ b/src/compat/stdin.h
@@ -0,0 +1,18 @@
+// Copyright (c) 2018 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#ifndef BITCOIN_COMPAT_STDIN_H
+#define BITCOIN_COMPAT_STDIN_H
+
+struct NoechoInst {
+ NoechoInst();
+ ~NoechoInst();
+};
+
+#define NO_STDIN_ECHO() NoechoInst _no_echo
+
+bool StdinTerminal();
+bool StdinReady();
+
+#endif // BITCOIN_COMPAT_STDIN_H