aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-08-25 19:55:52 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-09-28 16:24:30 -0700
commitc091b99379b97cb314c9fa123beabdbc324cf7a4 (patch)
treef1cc720f195b18842831f964a3dd1fc71d29a4ff /src/wallet/wallet.cpp
parentbd355b8db9ffaacaafd10eb14f6b74cf00d8fc06 (diff)
downloadbitcoin-c091b99379b97cb314c9fa123beabdbc324cf7a4.tar.xz
Implement BIP173 addresses and tests
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index fd2c1dfbe7..594b82a09e 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -111,7 +111,26 @@ public:
Process(script);
}
- void operator()(const CNoDestination &none) {}
+ void operator()(const WitnessV0ScriptHash& scriptID)
+ {
+ CScriptID id;
+ CRIPEMD160().Write(scriptID.begin(), 32).Finalize(id.begin());
+ CScript script;
+ if (keystore.GetCScript(id, script)) {
+ Process(script);
+ }
+ }
+
+ void operator()(const WitnessV0KeyHash& keyid)
+ {
+ CKeyID id(keyid);
+ if (keystore.HaveKey(id)) {
+ vKeys.push_back(id);
+ }
+ }
+
+ template<typename X>
+ void operator()(const X &none) {}
};
const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const