Skip to content

Commit

Permalink
Fixes bug caused by invalid GIV transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
embiimob committed Feb 14, 2023
1 parent 6433519 commit 6dd1e82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions P2FK/classes/OBJ.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,16 @@ public static OBJState GetObjectByAddress(string objectaddress, string username,
break;
}

if (givinspector == null || givinspector.Count < 2)
if (givinspector == null)
{
logstatus = "[\"" + transaction.SignedBy + "\",\"" + objectaddress + "\",\"give\",\"\",\"\",\"failed due to no data\"]";
break;
}
int giveCount = 0;
foreach (var give in givinspector)
{
int qtyToGive = 0;
string giver = transaction.SignedBy;

string reciever;

try
Expand All @@ -292,8 +292,16 @@ public static OBJState GetObjectByAddress(string objectaddress, string username,
logstatus = "[\"" + transaction.SignedBy + "\",\"" + objectaddress + "\",\"give\",\"\",\"\",\"failed due to invalid keyword count\"]";
break;
}
try
{
qtyToGive = give[1];
}
catch
{
logstatus = "[\"" + transaction.SignedBy + "\",\"" + objectaddress + "\",\"give\",\"\",\"\",\"failed due to invalid keyword count\"]";
break;
}

int qtyToGive = give[1];
giveCount++;
string sortableGiveCount = giveCount.ToString("X").PadLeft(4, '0');

Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.7.0")]
[assembly: AssemblyFileVersion("0.1.7.0")]
[assembly: AssemblyVersion("0.1.8.0")]
[assembly: AssemblyFileVersion("0.1.8.0")]

0 comments on commit 6dd1e82

Please sign in to comment.