Skip to content

Commit 6a4ee52

Browse files
committed
fix: replace assert to if-return. Less probability to get troubles in the future
1 parent 7460211 commit 6a4ee52

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/spork.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ bool CSporkManager::ProcessSpork(const CSporkMessage& spork)
144144
uint256 hash = spork.GetHash();
145145
std::string strLogMsg{strprintf("SPORK -- hash: %s id: %d value: %10d", hash.ToString(), spork.nSporkID,
146146
spork.nValue)};
147-
assert(spork.GetSignerKeyID().has_value());
147+
148+
if (!spork.GetSignerKeyID().has_value()) return false;
149+
148150
auto keyIDSigner = spork.GetSignerKeyID().value();
149151

150152
{

0 commit comments

Comments
 (0)