mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-19 22:50:44 +02:00
Disallow extended encoding for non-witness transactions
This commit is contained in:
parent
540bf8aacc
commit
bb530efa18
@ -220,6 +220,10 @@ inline void UnserializeTransaction(TxType& tx, Stream& s) {
|
|||||||
for (size_t i = 0; i < tx.vin.size(); i++) {
|
for (size_t i = 0; i < tx.vin.size(); i++) {
|
||||||
s >> tx.vin[i].scriptWitness.stack;
|
s >> tx.vin[i].scriptWitness.stack;
|
||||||
}
|
}
|
||||||
|
if (!tx.HasWitness()) {
|
||||||
|
/* It's illegal to encode witnesses when all witness stacks are empty. */
|
||||||
|
throw std::ios_base::failure("Superfluous witness record");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (flags) {
|
if (flags) {
|
||||||
/* Unknown flag in the serialization */
|
/* Unknown flag in the serialization */
|
||||||
|
Loading…
Reference in New Issue
Block a user