Skip to content

Commit

Permalink
Fixed output string, using GetLockingScriptHexString()
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Oct 7, 2020
1 parent f0fa30f commit 8436605
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ func CalculateFeeForTx(tx *transaction.Transaction, standardRate, dataRate float
// Loop all outputs and accumulate size (find data related outputs)
for _, out := range tx.GetOutputs() {
// todo: once libsv has outs.data.ToBytes() this can be removed/optimized
if strings.HasPrefix(out.String(), "&006a") || strings.HasPrefix(out.String(), "&6a") {
outHexString := out.GetLockingScriptHexString()
if strings.HasPrefix(outHexString, "006a") || strings.HasPrefix(outHexString, "6a") {
totalDataBytes = totalDataBytes + len(out.ToBytes())
}
}
Expand Down

0 comments on commit 8436605

Please sign in to comment.