mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Extract consts for WITNESS_V0 hash sizes
This commit is contained in:
parent
0a8054e7cd
commit
3450a9b25c
4 changed files with 11 additions and 7 deletions
|
|
@ -66,12 +66,12 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::v
|
|||
int witnessversion;
|
||||
std::vector<unsigned char> witnessprogram;
|
||||
if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {
|
||||
if (witnessversion == 0 && witnessprogram.size() == 20) {
|
||||
if (witnessversion == 0 && witnessprogram.size() == WITNESS_V0_KEYHASH_SIZE) {
|
||||
typeRet = TX_WITNESS_V0_KEYHASH;
|
||||
vSolutionsRet.push_back(witnessprogram);
|
||||
return true;
|
||||
}
|
||||
if (witnessversion == 0 && witnessprogram.size() == 32) {
|
||||
if (witnessversion == 0 && witnessprogram.size() == WITNESS_V0_SCRIPTHASH_SIZE) {
|
||||
typeRet = TX_WITNESS_V0_SCRIPTHASH;
|
||||
vSolutionsRet.push_back(witnessprogram);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue