Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTxsOutOfRange = errors.New("current txs is out of range") ErrGasOutOfRange = errors.New("parent gas price is out of range") )
Functions ¶
This section is empty.
Types ¶
type Gas ¶
type Gas struct {
// contains filtered or unexported fields
}
func (*Gas) CalNextGasPrice ¶
CalNextGasPrice returns the current block gas price, based on the formula:
G_c = G_p * (1 + (0.5 * (MaxBatchSize - TxsCount) / MaxBatchSize))
if G_c <= minGasPrice, G_c = minGasPrice
if G_c >= maxGasPrice, G_c = maxGasPrice
Click to show internal directories.
Click to hide internal directories.