From 3e49970ed6b25c8d4a63b7380e48c16d198a92ec Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Wed, 28 Apr 2021 16:25:58 +0000 Subject: [PATCH] primitives: do not de/serialize asset issuance in bitcoin mode Fixes a fuzztest failure related to `g_con_elementsmode`. --- src/primitives/transaction.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 0bdad772a04..d15ea944f71 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -146,7 +146,7 @@ class CTxIn inline void Serialize(Stream& s) const { bool fHasAssetIssuance; COutPoint outpoint; - if (prevout.n == (uint32_t) -1) { + if (!g_con_elementsmode || prevout.n == (uint32_t) -1) { // Coinbase inputs do not have asset issuances attached // to them. fHasAssetIssuance = false; @@ -189,7 +189,7 @@ class CTxIn COutPoint outpoint; s >> outpoint; - if (outpoint.n == (uint32_t) -1) { + if (!g_con_elementsmode || outpoint.n == (uint32_t) -1) { // No asset issuance for Coinbase inputs. fHasAssetIssuance = false; prevout = outpoint;