Skip to content

Commit

Permalink
primitives: do not de/serialize asset issuance in bitcoin mode
Browse files Browse the repository at this point in the history
Fixes a fuzztest failure related to `g_con_elementsmode`.
  • Loading branch information
apoelstra committed Apr 28, 2021
1 parent 4250452 commit 3e49970
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/primitives/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3e49970

Please sign in to comment.