@@ -50,7 +50,7 @@ program(const transaction& tx, const input_iterator& input,
50
50
version_(script_version::unversioned),
51
51
primary_()
52
52
{
53
- BC_ASSERT ( script_->offset == script_-> ops (). begin () );
53
+ script_->clear_offset ( );
54
54
}
55
55
56
56
// Legacy p2sh or prevout script run (copied input stack - use first).
@@ -68,7 +68,7 @@ program(const program& other, const script::cptr& script) NOEXCEPT
68
68
version_(other.version_),
69
69
primary_(other.primary_)
70
70
{
71
- BC_ASSERT ( script_->offset == script_-> ops (). begin () );
71
+ script_->clear_offset ( );
72
72
}
73
73
74
74
// Legacy p2sh or prevout script run (moved input stack/tether - use last).
@@ -83,7 +83,7 @@ program(program&& other, const script::cptr& script) NOEXCEPT
83
83
version_(other.version_),
84
84
primary_(std::move(other.primary_))
85
85
{
86
- BC_ASSERT ( script_->offset == script_-> ops (). begin () );
86
+ script_->clear_offset ( );
87
87
}
88
88
89
89
// Segwit script run (witness-initialized stack).
@@ -104,7 +104,7 @@ program(const transaction& tx, const input_iterator& input,
104
104
witness_(witness),
105
105
primary_(projection<Stack>(*witness))
106
106
{
107
- BC_ASSERT ( script_->offset == script_-> ops (). begin () );
107
+ script_->clear_offset ( );
108
108
}
109
109
110
110
// Taproot script run (witness-initialized stack).
@@ -128,7 +128,7 @@ program(const transaction& tx, const input_iterator& input,
128
128
primary_(projection<Stack>(*witness)),
129
129
budget_(ceilinged_add(add1(chain::signature_budget), witness_size))
130
130
{
131
- BC_ASSERT ( script_->offset == script_-> ops (). begin () );
131
+ script_->clear_offset ( );
132
132
}
133
133
134
134
// Public.
@@ -841,7 +841,12 @@ ecdsa_prepare(ec_signature& signature, hash_digest& hash,
841
841
if (!ecdsa::parse_endorsement (sighash_flags, distinguished, *endorsement))
842
842
return false ;
843
843
844
- // TODO: re-evaluate multisig hash caching.
844
+ // TODO: create array of 6 pointers (48 bytes).
845
+ // TODO: map each pointer type to contiguous array element.
846
+ // TODO: look up in array before computing hash, store after computing.
847
+ // TODO: store as program member, reset after each op_multisig.
848
+ // TODO: total cost is 6x8=48 bytes per thread, search/assign array.
849
+ // TODO: no hash function and no alloc/realloc.
845
850
// //hash_cache cache{};
846
851
// //const auto& hash = cache.at(sighash_flags);
847
852
0 commit comments