mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
refactor: Extract RIPEMD160
To directly return a CRIPEMD160 hash from data. Incidentally, decoding this acronym: * RIPEMD -> RIPE Message Digest * RIPE -> RACE Integrity Primitives Evaluation * RACE -> Research and Development in Advanced Communications Technologies in Europe
This commit is contained in:
parent
7386da7a0b
commit
6879be691b
8 changed files with 27 additions and 20 deletions
|
|
@ -4,11 +4,13 @@
|
|||
|
||||
#include <script/descriptor.h>
|
||||
|
||||
#include <hash.h>
|
||||
#include <key_io.h>
|
||||
#include <pubkey.h>
|
||||
#include <script/miniscript.h>
|
||||
#include <script/script.h>
|
||||
#include <script/standard.h>
|
||||
#include <uint256.h>
|
||||
|
||||
#include <span.h>
|
||||
#include <util/bip32.h>
|
||||
|
|
@ -1618,8 +1620,7 @@ std::unique_ptr<DescriptorImpl> InferScript(const CScript& script, ParseScriptCo
|
|||
}
|
||||
}
|
||||
if (txntype == TxoutType::WITNESS_V0_SCRIPTHASH && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH)) {
|
||||
CScriptID scriptid;
|
||||
CRIPEMD160().Write(data[0].data(), data[0].size()).Finalize(scriptid.begin());
|
||||
CScriptID scriptid{RIPEMD160(data[0])};
|
||||
CScript subscript;
|
||||
if (provider.GetCScript(scriptid, subscript)) {
|
||||
auto sub = InferScript(subscript, ParseScriptContext::P2WSH, provider);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue