Skip to content

Commit 3932006

Browse files
author
eric
committed
set eth.gasPrice from a smart contract
1 parent a87842c commit 3932006

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

eth/backend.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,12 @@ func getCurrentGasPriceFunc(eth *Ethereum, ee *ethapi.PublicBlockChainAPI) func(
644644
if eth.APIBackend.gpo.GetMaxPrice() == nil || eth.APIBackend.gpo.GetMaxPrice().Cmp(maxPrice) != 0 {
645645
eth.APIBackend.gpo.SetMaxPrice(maxPrice)
646646
}
647+
if eth.gasPrice == nil || eth.gasPrice.Cmp(gasPrice) != 0 {
648+
eth.lock.Lock()
649+
eth.gasPrice = gasPrice
650+
eth.lock.Unlock()
651+
652+
}
647653
}
648654
return gasPrice, nil
649655
}

0 commit comments

Comments
 (0)