validation: check subsidy asset and amount are explicit

This commit is contained in:
Byron Hambly 2026-06-24 14:21:37 +02:00
parent 71b3bfe271
commit 6435e06408
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697

View file

@ -673,7 +673,7 @@ private:
// calculate the burned subsidy value from the tx
CAmount subsidy = 0;
for (const CTxOut& txout : tx.vout) {
if (txout.scriptPubKey.IsUnspendable() && txout.nAsset.GetAsset() == Params().GetConsensus().pegged_asset && !txout.IsFee()) {
if (txout.scriptPubKey.IsUnspendable() && !txout.IsFee() && txout.nAsset.IsExplicit() && txout.nValue.IsExplicit() && txout.nAsset.GetAsset() == Params().GetConsensus().pegged_asset) {
subsidy += txout.nValue.GetAmount();
}
}