Skip to content

Commit

Permalink
Fall back to 400 sigops if field is missing
Browse files Browse the repository at this point in the history
This makes the Template Provider backward compatible if the spec is updated.
  • Loading branch information
Sjors committed Jan 27, 2025
1 parent 47705fd commit 0ede234
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/sv2/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,14 @@ struct Sv2CoinbaseOutputConstraintsMsg
void Unserialize(Stream& s)
{
s >> m_coinbase_output_max_additional_size;
s >> m_coinbase_output_max_sigops;
try {
// This field was added to the spec on ...,
// SRI roles before ... do not provide it.
s >> m_coinbase_output_max_sigops;
} catch (const std::ios_base::failure& e) {
// Just use the default if it's missing
m_coinbase_output_max_sigops = 400;
}
}
};

Expand Down

0 comments on commit 0ede234

Please sign in to comment.