mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
descriptor: assert we never parse a sane miniscript with no pubkey
This commit is contained in:
parent
a49402a9ec
commit
c7db88af71
1 changed files with 4 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <common/args.h>
|
||||
#include <span.h>
|
||||
#include <util/bip32.h>
|
||||
#include <util/check.h>
|
||||
#include <util/spanparsing.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/vector.h>
|
||||
|
@ -1566,6 +1567,9 @@ std::unique_ptr<DescriptorImpl> ParseScript(uint32_t& key_exp_index, Span<const
|
|||
}
|
||||
return nullptr;
|
||||
}
|
||||
// A signature check is required for a miniscript to be sane. Therefore no sane miniscript
|
||||
// may have an empty list of public keys.
|
||||
CHECK_NONFATAL(!parser.m_keys.empty());
|
||||
return std::make_unique<MiniscriptDescriptor>(std::move(parser.m_keys), std::move(node));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue