mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
miniscript: adapt resources checks depending on context
Under Tapscript, there is: - No limit on the number of OPs - No limit on the script size, it's implicitly limited by the maximum (standard) transaction size. - No standardness limit on the number of stack items, it's limited by the consensus MAX_STACK_SIZE. This requires tracking the maximum stack size at all times during script execution, which will be tackled in its own commit. In order to avoid any Miniscript that would not be spendable by a standard transaction because of the size of the witness, we limit the script size under Tapscript to the maximum standard transaction size minus the maximum possible witness and Taproot control block sizes. Note this is a conservative limit but it still allows for scripts more than a hundred times larger than under P2WSH.
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
#include <vector>
|
||||
#include <script/script.h>
|
||||
#include <script/miniscript.h>
|
||||
#include <serialize.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
namespace miniscript {
|
||||
|
||||
namespace internal {
|
||||
|
||||
Type SanitizeType(Type e) {
|
||||
|
||||
Reference in New Issue
Block a user