core: fix default asset expiration to match C# code

Fixes bogus verification failures for non-native assets.
This commit is contained in:
Roman Khimov 2019-09-30 17:27:41 +03:00
parent 832c56f97d
commit 1095abb04c

View file

@ -22,6 +22,13 @@ import (
const ( const (
headerBatchCount = 2000 headerBatchCount = 2000
version = "0.0.1" version = "0.0.1"
// This one comes from C# code and it's different from the constant used
// when creating an asset with Neo.Asset.Create interop call. It looks
// like 2000000 is coming from the decrementInterval, but C# code doesn't
// contain any relationship between the two, so we should follow this
// behavior.
registeredAssetLifetime = 2 * 2000000
) )
var ( var (
@ -365,6 +372,7 @@ func (bc *Blockchain) storeBlock(block *Block) error {
Precision: t.Precision, Precision: t.Precision,
Owner: t.Owner, Owner: t.Owner,
Admin: t.Admin, Admin: t.Admin,
Expiration: bc.BlockHeight() + registeredAssetLifetime,
} }
case *transaction.IssueTX: case *transaction.IssueTX:
case *transaction.ClaimTX: case *transaction.ClaimTX: