mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge #402: Disallow extended encoding for non-witness transactions
8719c94 Disallow extended encoding for non-witness transactions (Pieter Wuille)
Pull request description:
Backport from upstream https://github.com/bitcoin/bitcoin/pull/14039
Tree-SHA512: a91810e0afe4d631e2e08cd1bc919e83e3dbdac050f1a66ddc0c6210b222e5813f5b36b27111976e83a4c7683507e4ed06ef475467e1c0e572ccb3d0abc631e4
This commit is contained in:
commit
aaee9dde6f
1 changed files with 4 additions and 0 deletions
|
|
@ -655,6 +655,10 @@ inline void UnserializeTransaction(TxType& tx, Stream& s) {
|
|||
const_cast<CTxWitness*>(&tx.wit)->vtxinwit.resize(tx.vin.size());
|
||||
const_cast<CTxWitness*>(&tx.wit)->vtxoutwit.resize(tx.vout.size());
|
||||
s >> tx.wit;
|
||||
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) {
|
||||
/* Unknown flag in the serialization */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue