mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-30 08:49:29 +02:00
scripted-diff: Use std::span over Span
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s!\<$1\>!$2!g" $( git grep -l "$1" -- "./src" ":(exclude)src/span.h" ":(exclude)src/leveldb/db/log_test.cc" ) ; }
ren Span std::span
ren AsBytes std::as_bytes
ren AsWritableBytes std::as_writable_bytes
sed -i 's!SpanPopBack(Span!SpanPopBack(std::span!g' ./src/span.h
-END VERIFY SCRIPT-
This commit is contained in:
@@ -28,7 +28,7 @@ static constexpr uint8_t SIGNET_HEADER[4] = {0xec, 0xc7, 0xda, 0xa2};
|
||||
|
||||
static constexpr unsigned int BLOCK_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_NULLDUMMY;
|
||||
|
||||
static bool FetchAndClearCommitmentSection(const Span<const uint8_t> header, CScript& witness_commitment, std::vector<uint8_t>& result)
|
||||
static bool FetchAndClearCommitmentSection(const std::span<const uint8_t> header, CScript& witness_commitment, std::vector<uint8_t>& result)
|
||||
{
|
||||
CScript replacement;
|
||||
bool found_header = false;
|
||||
@@ -39,7 +39,7 @@ static bool FetchAndClearCommitmentSection(const Span<const uint8_t> header, CSc
|
||||
std::vector<uint8_t> pushdata;
|
||||
while (witness_commitment.GetOp(pc, opcode, pushdata)) {
|
||||
if (pushdata.size() > 0) {
|
||||
if (!found_header && pushdata.size() > header.size() && std::ranges::equal(Span{pushdata}.first(header.size()), header)) {
|
||||
if (!found_header && pushdata.size() > header.size() && std::ranges::equal(std::span{pushdata}.first(header.size()), header)) {
|
||||
// pushdata only counts if it has the header _and_ some data
|
||||
result.insert(result.end(), pushdata.begin() + header.size(), pushdata.end());
|
||||
pushdata.erase(pushdata.begin() + header.size(), pushdata.end());
|
||||
|
||||
Reference in New Issue
Block a user