update namereg with longer names, more allowed chars

This commit is contained in:
Ethan Buchman
2015-09-15 18:39:01 -04:00
parent 78768082a1
commit e4f0e2b399
5 changed files with 38 additions and 32 deletions

View File

@ -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 {