mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
handle unwell sub on success
This commit is contained in:
parent
409eea4063
commit
eed426c36f
1 changed files with 6 additions and 2 deletions
|
|
@ -55,6 +55,7 @@ import (
|
|||
const estimateGasErrorRatio = 0.015
|
||||
|
||||
var errBlobTxNotSupported = errors.New("signing blob transactions not supported")
|
||||
var errSubClosed = errors.New("chain subscription closed")
|
||||
|
||||
// EthereumAPI provides an API to access Ethereum related information.
|
||||
type EthereumAPI struct {
|
||||
|
|
@ -1710,11 +1711,14 @@ func (api *TransactionAPI) SendRawTransactionSync(ctx context.Context, input hex
|
|||
|
||||
case err, ok := <-subErrCh:
|
||||
if !ok {
|
||||
return nil, errors.New("chain subscription closed")
|
||||
return nil, errSubClosed
|
||||
}
|
||||
return nil, err
|
||||
|
||||
case ev := <-ch:
|
||||
case ev, ok := <-ch:
|
||||
if !ok {
|
||||
return nil, errSubClosed
|
||||
}
|
||||
rs := ev.Receipts
|
||||
txs := ev.Transactions
|
||||
if len(rs) == 0 || len(rs) != len(txs) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue