mirror of https://github.com/oxen-io/oxen-core.git
Fail if tx blob is empty
Some node on the network apparently has a corrupted DB and is spewing empty tx blobs onto the network. Detect such a case rather than broadcasting broken empty txes.
This commit is contained in:
parent
e120075c37
commit
a6157fe0a9
|
@ -1998,6 +1998,9 @@ bool BlockchainLMDB::get_txpool_tx_blob(const crypto::hash& txid, std::string &b
|
|||
if (result != 0)
|
||||
throw1(DB_ERROR(lmdb_error("Error finding txpool tx blob: ", result).c_str()));
|
||||
|
||||
if (v.mv_size == 0)
|
||||
throw1(DB_ERROR("Error finding txpool tx blob: tx is present, but data is empty"));
|
||||
|
||||
bd.assign(reinterpret_cast<const char*>(v.mv_data), v.mv_size);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue