Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/groovy_gluon_7.2RC' into…
Browse files Browse the repository at this point in the history
… mainnet
  • Loading branch information
anatolse committed Nov 7, 2022
2 parents 826d41c + a6e0063 commit 471c4a8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions node/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2773,6 +2773,7 @@ Asset::ID NodeDB::AssetFindMinFree(Asset::ID nMin)
void NodeDB::AssetAdd(Asset::Full& ai)
{
Asset::ID aidMin = ai.m_ID;
assert(aidMin < s_AssetEmpty0);
// find free index
ai.m_ID = AssetFindMinFree(ai.m_ID + s_AssetEmpty0);
if (ai.m_ID)
Expand Down Expand Up @@ -2800,6 +2801,7 @@ void NodeDB::AssetAdd(Asset::Full& ai)

Asset::ID NodeDB::AssetDelete(Asset::ID id)
{
assert(id < s_AssetEmpty0);
AssetDeleteRaw(id);

Asset::ID nCount = static_cast<Asset::ID>(ParamIntGetDef(ParamID::AssetsCount));
Expand Down Expand Up @@ -2836,6 +2838,9 @@ void NodeDB::AssetsDelAll()

bool NodeDB::AssetGetSafe(Asset::Full& ai)
{
if (ai.m_ID >= s_AssetEmpty0)
return false;

Recordset rs(*this, Query::AssetGet, "SELECT " TblAssets_Value "," TblAssets_Owner "," TblAssets_Cid "," TblAssets_Data "," TblAssets_Deposit "," TblAssets_LockHeight " FROM " TblAssets " WHERE " TblAssets_ID "=?");
rs.put(0, ai.m_ID);
if (!rs.Step())
Expand Down

0 comments on commit 471c4a8

Please sign in to comment.