Skip to content

Commit

Permalink
Disable chain object construction from moved fast streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jan 29, 2024
1 parent c474676 commit b34e788
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 48 deletions.
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class BC_API block
const transactions_cptr& txs) NOEXCEPT;

block(const data_slice& data, bool witness) NOEXCEPT;
block(stream::in::fast&& stream, bool witness) NOEXCEPT;
////block(stream::in::fast&& stream, bool witness) NOEXCEPT;
block(stream::in::fast& stream, bool witness) NOEXCEPT;
block(std::istream&& stream, bool witness) NOEXCEPT;
block(std::istream& stream, bool witness) NOEXCEPT;
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class BC_API header
uint32_t nonce) NOEXCEPT;

header(const data_slice& data) NOEXCEPT;
header(stream::in::fast&& stream) NOEXCEPT;
////header(stream::in::fast&& stream) NOEXCEPT;
header(stream::in::fast& stream) NOEXCEPT;
header(std::istream&& stream) NOEXCEPT;
header(std::istream& stream) NOEXCEPT;
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class BC_API input
const chain::witness::cptr& witness, uint32_t sequence) NOEXCEPT;

input(const data_slice& data) NOEXCEPT;
input(stream::in::fast&& stream) NOEXCEPT;
////input(stream::in::fast&& stream) NOEXCEPT;
input(stream::in::fast& stream) NOEXCEPT;
input(std::istream&& stream) NOEXCEPT;
input(std::istream& stream) NOEXCEPT;
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/operation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class BC_API operation

/// These deserialize operations (with codes), not from push-data.
operation(const data_slice& op_data) NOEXCEPT;
operation(stream::in::fast&& stream) NOEXCEPT;
////operation(stream::in::fast&& stream) NOEXCEPT;
operation(stream::in::fast& stream) NOEXCEPT;
operation(std::istream&& stream) NOEXCEPT;
operation(std::istream& stream) NOEXCEPT;
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BC_API output
output(uint64_t value, const chain::script::cptr& script) NOEXCEPT;

output(const data_slice& data) NOEXCEPT;
output(stream::in::fast&& stream) NOEXCEPT;
////output(stream::in::fast&& stream) NOEXCEPT;
output(stream::in::fast& stream) NOEXCEPT;
output(std::istream&& stream) NOEXCEPT;
output(std::istream& stream) NOEXCEPT;
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class BC_API point
point(const hash_digest& hash, uint32_t index) NOEXCEPT;

point(const data_slice& data) NOEXCEPT;
point(stream::in::fast&& stream) NOEXCEPT;
////point(stream::in::fast&& stream) NOEXCEPT;
point(stream::in::fast& stream) NOEXCEPT;
point(std::istream&& stream) NOEXCEPT;
point(std::istream& stream) NOEXCEPT;
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/script.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class BC_API script
script(operations&& ops, bool prefail) NOEXCEPT;
script(const operations& ops, bool prefail) NOEXCEPT;
script(const data_slice& data, bool prefix) NOEXCEPT;
script(stream::in::fast&& stream, bool prefix) NOEXCEPT;
////script(stream::in::fast&& stream, bool prefix) NOEXCEPT;
script(stream::in::fast& stream, bool prefix) NOEXCEPT;
script(std::istream&& stream, bool prefix) NOEXCEPT;
script(std::istream& stream, bool prefix) NOEXCEPT;
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class BC_API transaction
const outputs_cptr& outputs, uint32_t locktime) NOEXCEPT;

transaction(const data_slice& data, bool witness) NOEXCEPT;
transaction(stream::in::fast&& stream, bool witness) NOEXCEPT;
////transaction(stream::in::fast&& stream, bool witness) NOEXCEPT;
transaction(stream::in::fast& stream, bool witness) NOEXCEPT;
transaction(std::istream&& stream, bool witness) NOEXCEPT;
transaction(std::istream& stream, bool witness) NOEXCEPT;
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/witness.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BC_API witness
witness(const chunk_cptrs& stack) NOEXCEPT;

witness(const data_slice& data, bool prefix) NOEXCEPT;
witness(stream::in::fast&& stream, bool prefix) NOEXCEPT;
////witness(stream::in::fast&& stream, bool prefix) NOEXCEPT;
witness(stream::in::fast& stream, bool prefix) NOEXCEPT;
witness(std::istream&& stream, bool prefix) NOEXCEPT;
witness(std::istream& stream, bool prefix) NOEXCEPT;
Expand Down
8 changes: 4 additions & 4 deletions src/chain/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ block::block(const data_slice& data, bool witness) NOEXCEPT
{
}

block::block(stream::in::fast&& stream, bool witness) NOEXCEPT
: block(read::bytes::fast(stream), witness)
{
}
////block::block(stream::in::fast&& stream, bool witness) NOEXCEPT
//// : block(read::bytes::fast(stream), witness)
////{
////}

block::block(stream::in::fast& stream, bool witness) NOEXCEPT
: block(read::bytes::fast(stream), witness)
Expand Down
8 changes: 4 additions & 4 deletions src/chain/header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ header::header(const data_slice& data) NOEXCEPT
{
}

header::header(stream::in::fast&& stream) NOEXCEPT
: header(read::bytes::fast(stream))
{
}
////header::header(stream::in::fast&& stream) NOEXCEPT
//// : header(read::bytes::fast(stream))
////{
////}

header::header(stream::in::fast& stream) NOEXCEPT
: header(read::bytes::fast(stream))
Expand Down
12 changes: 5 additions & 7 deletions src/chain/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ input::input(const data_slice& data) NOEXCEPT
{
}

input::input(stream::in::fast&& stream) NOEXCEPT
: input(read::bytes::fast(stream))
{
}
////input::input(stream::in::fast&& stream) NOEXCEPT
//// : input(read::bytes::fast(stream))
////{
////}

input::input(stream::in::fast& stream) NOEXCEPT
: input(read::bytes::fast(stream))
Expand Down Expand Up @@ -341,9 +341,7 @@ bool input::extract_sigop_script(chain::script& out,

// Parse the embedded script from the last input script item (data).
// This cannot fail because there is no prefix to invalidate the length.
// Workaround: XCode inteprets this as both prvalue and rvalue (ambiguous).
////out = { ops.back().data(), false };
out = std::move(chain::script{ ops.back().data(), false });
out = { ops.back().data(), false };
return true;
}

Expand Down
8 changes: 4 additions & 4 deletions src/chain/operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ operation::operation(const data_slice& op_data) NOEXCEPT
{
}

operation::operation(stream::in::fast&& stream) NOEXCEPT
: operation(read::bytes::fast(stream))
{
}
////operation::operation(stream::in::fast&& stream) NOEXCEPT
//// : operation(read::bytes::fast(stream))
////{
////}

operation::operation(stream::in::fast& stream) NOEXCEPT
: operation(read::bytes::fast(stream))
Expand Down
8 changes: 4 additions & 4 deletions src/chain/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ output::output(const data_slice& data) NOEXCEPT
{
}

output::output(stream::in::fast&& stream) NOEXCEPT
: output(read::bytes::fast(stream))
{
}
////output::output(stream::in::fast&& stream) NOEXCEPT
//// : output(read::bytes::fast(stream))
////{
////}

output::output(stream::in::fast& stream) NOEXCEPT
: output(read::bytes::fast(stream))
Expand Down
8 changes: 4 additions & 4 deletions src/chain/point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ point::point(const data_slice& data) NOEXCEPT
{
}

point::point(stream::in::fast&& stream) NOEXCEPT
: point(read::bytes::fast(stream))
{
}
////point::point(stream::in::fast&& stream) NOEXCEPT
//// : point(read::bytes::fast(stream))
////{
////}

point::point(stream::in::fast& stream) NOEXCEPT
: point(read::bytes::fast(stream))
Expand Down
8 changes: 4 additions & 4 deletions src/chain/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ script::script(const data_slice& data, bool prefix) NOEXCEPT
{
}

script::script(stream::in::fast&& stream, bool prefix) NOEXCEPT
: script(read::bytes::fast(stream), prefix)
{
}
////script::script(stream::in::fast&& stream, bool prefix) NOEXCEPT
//// : script(read::bytes::fast(stream), prefix)
////{
////}

script::script(stream::in::fast& stream, bool prefix) NOEXCEPT
: script(read::bytes::fast(stream), prefix)
Expand Down
8 changes: 4 additions & 4 deletions src/chain/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ transaction::transaction(const data_slice& data, bool witness) NOEXCEPT
{
}

transaction::transaction(stream::in::fast&& stream, bool witness) NOEXCEPT
: transaction(read::bytes::fast(stream), witness)
{
}
////transaction::transaction(stream::in::fast&& stream, bool witness) NOEXCEPT
//// : transaction(read::bytes::fast(stream), witness)
////{
////}

transaction::transaction(stream::in::fast& stream, bool witness) NOEXCEPT
: transaction(read::bytes::fast(stream), witness)
Expand Down
8 changes: 4 additions & 4 deletions src/chain/witness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ witness::witness(const data_slice& data, bool prefix) NOEXCEPT
{
}

witness::witness(stream::in::fast&& stream, bool prefix) NOEXCEPT
: witness(read::bytes::fast(stream), prefix)
{
}
////witness::witness(stream::in::fast&& stream, bool prefix) NOEXCEPT
//// : witness(read::bytes::fast(stream), prefix)
////{
////}

witness::witness(stream::in::fast& stream, bool prefix) NOEXCEPT
: witness(read::bytes::fast(stream), prefix)
Expand Down

0 comments on commit b34e788

Please sign in to comment.