Skip to content

Commit 501d11c

Browse files
authored
Merge pull request #6 from node-real/netmarble_v2.0_dev
fix:set the code of eth.gasPrice location error
2 parents ab4ab29 + 77f01cc commit 501d11c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

eth/backend.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -637,12 +637,14 @@ func getCurrentGasPriceFunc(eth *Ethereum, ee *ethapi.PublicBlockChainAPI) func(
637637
if err := chainConfig.UnpackIntoInterface(&gasPrice, method, result); err != nil {
638638
return nil, err
639639
}
640-
if gasPrice != nil && eth.APIBackend.gpo != nil && gasPrice.Cmp(common.Big0) > 0 {
641-
if eth.APIBackend.gpo.GetDefaultPrice() == nil || eth.APIBackend.gpo.GetDefaultPrice().Cmp(gasPrice) != 0 {
642-
eth.APIBackend.gpo.SetDefaultPrice(gasPrice)
643-
}
644-
if eth.APIBackend.gpo.GetMaxPrice() == nil || eth.APIBackend.gpo.GetMaxPrice().Cmp(maxPrice) != 0 {
645-
eth.APIBackend.gpo.SetMaxPrice(maxPrice)
640+
if gasPrice != nil && gasPrice.Cmp(common.Big0) > 0 {
641+
if eth.APIBackend.gpo != nil {
642+
if eth.APIBackend.gpo.GetDefaultPrice() == nil || eth.APIBackend.gpo.GetDefaultPrice().Cmp(gasPrice) != 0 {
643+
eth.APIBackend.gpo.SetDefaultPrice(gasPrice)
644+
}
645+
if eth.APIBackend.gpo.GetMaxPrice() == nil || eth.APIBackend.gpo.GetMaxPrice().Cmp(maxPrice) != 0 {
646+
eth.APIBackend.gpo.SetMaxPrice(maxPrice)
647+
}
646648
}
647649
if eth.gasPrice == nil || eth.gasPrice.Cmp(gasPrice) != 0 {
648650
eth.lock.Lock()

0 commit comments

Comments
 (0)