Skip to content

Commit 8f70e9f

Browse files
committed
Comments.
1 parent e540a0f commit 8f70e9f

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

include/bitcoin/system/impl/machine/interpreter.ipp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ op_check_sig_verify() NOEXCEPT
10251025
// If signature is not empty, it is validated against public key.
10261026
if (key->size() == schnorr::public_key_size)
10271027
{
1028-
// Split signature and signature hash flags.
1028+
// Split endorsement into schnorr sig and signature hash flags.
10291029
uint8_t sighash_flags;
10301030
const auto& sig = state::schnorr_split(sighash_flags, *endorsement);
10311031
if (sighash_flags == chain::coverage::invalid)
@@ -1160,7 +1160,7 @@ op_check_multisig_verify() NOEXCEPT
11601160
if (endorsement->empty())
11611161
continue;
11621162

1163-
// Split endorsement into DER signature signature hash flags.
1163+
// Split endorsement into DER signature and signature hash flags.
11641164
uint8_t sighash_flags;
11651165
const auto& der = state::ecdsa_split(sighash_flags, *endorsement);
11661166

@@ -1303,7 +1303,7 @@ op_check_sig_add() NOEXCEPT
13031303
return error::op_success;
13041304
}
13051305

1306-
// Split signature and signature hash flags.
1306+
// Split endorsement into schnorr signature and signature hash flags.
13071307
uint8_t sighash_flags;
13081308
const auto& sig = state::schnorr_split(sighash_flags, *endorsement);
13091309
if (sighash_flags == chain::coverage::invalid)

include/bitcoin/system/impl/machine/interpreter_connect.ipp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ code CLASS::connect_witness(const chain::context& state,
193193
if ((ec = input.witness().extract_script(script, stack, prevout)))
194194
return ec;
195195

196+
// TODO: either TAPROOT or TAPSCRIPT.
196197
interpreter program(tx, it, script, flags, version, stack, {});
197198

198199
if ((ec = program.run()))

include/bitcoin/system/impl/machine/program_sign.ipp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ schnorr_split(uint8_t& sighash_flags, const data_chunk& endorsement) NOEXCEPT
8080
{
8181
// BIP341: signature has sighash byte appended in the usual fashion.
8282
const auto byte = endorsement.back();
83+
84+
// BIP341: Defined sighash type required (otherwise invalid is set).
8385
if (is_schnorr_sighash(byte))
8486
sighash_flags = byte;
8587
}

src/chain/transaction_sign.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void transaction::signature_hash_single(writer& sink,
207207
for (size_t output = 0; output < index; ++output)
208208
sink.write_bytes(null_output());
209209

210-
// Guarded by unversioned_sighash.
210+
// Guarded by unversioned_sighash().
211211
outputs_->at(index)->to_data(sink);
212212
};
213213

@@ -306,7 +306,7 @@ bool transaction::unversioned_sighash(hash_digest& out,
306306
const input_iterator& input, const script& subscript,
307307
uint8_t sighash_flags) const NOEXCEPT
308308
{
309-
// Set options.
309+
// Mask anyone_can_pay and unused bits, and set hash_all by default.
310310
const auto flag = mask_sighash(sighash_flags);
311311

312312
//*************************************************************************

0 commit comments

Comments
 (0)