core, internal: fixes

This commit is contained in:
Gary Rong 2024-01-23 14:49:47 +08:00
parent e96541876b
commit 582216adfa
2 changed files with 2 additions and 2 deletions

View file

@ -179,7 +179,7 @@ func (indexer *txIndexer) report(head uint64) TxIndexProgress {
tail = rawdb.ReadTxIndexTail(indexer.db)
)
total := indexer.limit
if indexer.limit == 0 {
if indexer.limit == 0 || total > head {
total = head + 1 // genesis included
}
var indexed uint64

View file

@ -71,7 +71,7 @@ func (e *TxIndexingError) Error() string {
// ErrorCode returns the JSON error code for a revert.
// See: https://github.com/ethereum/wiki/wiki/JSON-RPC-Error-Codes-Improvement-Proposal
func (e *TxIndexingError) ErrorCode() int {
return 3 // TODO tbd
return -32000 // to be decided
}
// ErrorData returns the hex encoded revert reason.