Skip to content

Commit

Permalink
Fix how we compute witsecipt
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony committed Feb 18, 2025
1 parent 9155ebd commit 59ea941
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockcoreindexer",
"version": "0.2.72",
"version": "0.2.73",
"license": "MIT",
"author": {
"name": "Blockcore",
Expand Down
14 changes: 5 additions & 9 deletions src/Blockcore.Indexer.Core/Storage/Mongo/MongoData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -850,19 +850,15 @@ public async Task<List<MempoolTransaction>> GetMempoolTransactionListAsync(List<

static List<string> ComputeWitScript(string witScript)
{
List<string> scripts = new();
int index = 0;
while (index < witScript.Length)
if(string.IsNullOrEmpty(witScript))
{
string sizeHex = witScript.Substring(index, 2);
int size = int.Parse(sizeHex, System.Globalization.NumberStyles.HexNumber);
index += 2;
string script = witScript.Substring(index, size * 2);
scripts.Add(script);
return new List<string>();
}

return scripts;
var witscript = new WitScript(Script.FromHex(witScript).ToOps().ToArray());
return witscript.Pushes.Select(p => Op.GetPushOp(p).ToString()).ToList();
}

/// <summary>
/// Calculates the balance for specified address.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.2.72</Version>
<Version>0.2.73</Version>
<TargetFramework>net8.0</TargetFramework>
<Authors>Blockcore</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down

0 comments on commit 59ea941

Please sign in to comment.