mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Disallow coinbase output witness data, since outputs are explicit anyways
This commit is contained in:
parent
8b2e8859d6
commit
2cb47d1705
2 changed files with 10 additions and 3 deletions
|
|
@ -406,6 +406,14 @@ bool VerifyAmounts(const std::vector<CTxOut>& inputs, const CTransaction& tx, st
|
|||
|
||||
bool VerifyCoinbaseAmount(const CTransaction& tx, const CAmountMap& mapFees) {
|
||||
assert(tx.IsCoinBase());
|
||||
|
||||
// Miner shouldn't be stuffing witness data
|
||||
for (const auto& outwit : tx.witness.vtxoutwit) {
|
||||
if (!outwit.IsNull()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
CAmountMap remaining = mapFees;
|
||||
for (unsigned int i = 0; i < tx.vout.size(); i++) {
|
||||
const CTxOut& out = tx.vout[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue