mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-26 03:01:42 +00:00
update namereg with longer names, more allowed chars
This commit is contained in:
@ -543,14 +543,13 @@ func ExecTx(blockCache *BlockCache, tx types.Tx, runCall bool, evc events.Fireab
|
||||
|
||||
// validate the input strings
|
||||
if err := tx.ValidateStrings(); err != nil {
|
||||
log.Info(err.Error())
|
||||
return types.ErrTxInvalidString
|
||||
return err
|
||||
}
|
||||
|
||||
value := tx.Input.Amount - tx.Fee
|
||||
|
||||
// let's say cost of a name for one block is len(data) + 32
|
||||
costPerBlock := types.NameCostPerBlock * types.NameCostPerByte * tx.BaseEntryCost()
|
||||
costPerBlock := types.NameCostPerBlock(types.NameBaseCost(tx.Name, tx.Data))
|
||||
expiresIn := int(value / costPerBlock)
|
||||
lastBlockHeight := _s.LastBlockHeight
|
||||
|
||||
@ -591,7 +590,7 @@ func ExecTx(blockCache *BlockCache, tx types.Tx, runCall bool, evc events.Fireab
|
||||
} else {
|
||||
// since the size of the data may have changed
|
||||
// we use the total amount of "credit"
|
||||
oldCredit := int64(entry.Expires-lastBlockHeight) * types.BaseEntryCost(entry.Name, entry.Data)
|
||||
oldCredit := int64(entry.Expires-lastBlockHeight) * types.NameBaseCost(entry.Name, entry.Data)
|
||||
credit := oldCredit + value
|
||||
expiresIn = int(credit / costPerBlock)
|
||||
if expiresIn < types.MinNameRegistrationPeriod {
|
||||
|
Reference in New Issue
Block a user