mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Add minPriceUSD in L2DB, check maxTxs atomically
- Add config parameter `Coordinator.L2DB.MinPriceUSD` which allows rejecting txs to the pool that have a fee lower than the minimum. - In pool tx insertion, checking the number of pending txs atomically with the insertion to avoid data races leading to more than MaxTxs pending txs in the pool.
This commit is contained in:
@@ -447,7 +447,8 @@ func (hdb *HistoryDB) addTokens(d meddler.DB, tokens []common.Token) error {
|
||||
))
|
||||
}
|
||||
|
||||
// UpdateTokenValue updates the USD value of a token
|
||||
// UpdateTokenValue updates the USD value of a token. Value is the price in
|
||||
// USD of a normalized token (1 token = 10^decimals units)
|
||||
func (hdb *HistoryDB) UpdateTokenValue(tokenSymbol string, value float64) error {
|
||||
// Sanitize symbol
|
||||
tokenSymbol = strings.ToValidUTF8(tokenSymbol, " ")
|
||||
|
||||
Reference in New Issue
Block a user