Skip to content

Commit

Permalink
-Added check for 0 blockheight before setting claim height.
Browse files Browse the repository at this point in the history
  • Loading branch information
tiger5226 committed Mar 16, 2019
1 parent 40a2125 commit e70daa5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions daemon/processing/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ func processClaimNameScript(script *[]byte, vout model.Output, tx model.Transact
claim.Name = name
claim.TransactionTime = tx.TransactionTime
claim.ClaimAddress = lbrycrd.GetAddressFromPublicKeyScript(pkscript)
claim.Height = uint(blockHeight)
if blockHeight > 0 {
claim.Height = uint(blockHeight)
}
err = datastore.PutClaim(claim)

return name, claimid, pkscript, err
Expand Down Expand Up @@ -123,7 +125,9 @@ func processClaimUpdateScript(script *[]byte, vout model.Output, tx model.Transa
}
claim.TransactionTime = tx.TransactionTime
claim.ClaimAddress = lbrycrd.GetAddressFromPublicKeyScript(pubkeyscript)
claim.Height = uint(blockHeight)
if blockHeight > 0 {
claim.Height = uint(blockHeight)
}
claim.TransactionHashID.SetValid(tx.Hash)
claim.Vout = vout.Vout
if claim.BidState == "Spent" {
Expand Down

0 comments on commit e70daa5

Please sign in to comment.