mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #11167: Full BIP173 (Bech32) support
8213838[Qt] tolerate BIP173/bech32 addresses during input validation (Jonas Schnelli)06eaca6[RPC] Wallet: test importing of native witness scripts (NicolasDorier)fd0041aUse BIP173 addresses in segwit.py test (Pieter Wuille)e278f12Support BIP173 in addwitnessaddress (Pieter Wuille)c091b99Implement BIP173 addresses and tests (Pieter Wuille)bd355b8Add regtest testing to base58_tests (Pieter Wuille)6565c55Convert base58_tests from type/payload to scriptPubKey comparison (Pieter Wuille)8fd2267Import Bech32 C++ reference code & tests (Pieter Wuille)1e46ebdImplement {Encode,Decode}Destination without CBitcoinAddress (Pieter Wuille) Pull request description: Builds on top of #11117. This adds support for: * Creating BIP173 addresses for testing (through `addwitnessaddress`, though by default it still produces P2SH versions) * Sending to BIP173 addresses (including non-v0 ones) * Analysing BIP173 addresses (through `validateaddress`) It includes a reformatted version of the [C++ Bech32 reference code](https://github.com/sipa/bech32/tree/master/ref/c%2B%2B) and an independent implementation of the address encoding/decoding logic (integrated with CTxDestination). All BIP173 test vectors are included. Not included (and intended for other PRs): * Full wallet support for SegWit (which would include automatically adding witness scripts to the wallet during automatic keypool topup, SegWit change outputs, ...) [see #11403] * Splitting base58.cpp and tests/base58_tests.cpp up into base58-specific code, and "address encoding"-code [see #11372] * Error locating in UI for BIP173 addresses. Tree-SHA512: 238031185fd07f3ac873c586043970cc2db91bf7735c3c168cb33a3db39a7bda81d4891b649685bb17ef90dc63af0328e7705d8cd3e8dafd6c4d3c08fb230341
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user