mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
Fix xdcx infinite recursive calls (#404)
* fix: Make the unused methods in leveldb.go in XDCxDAO to panic or return error if called * fix: apply the same fix in mongodb of the XDCxDAO as well
This commit is contained in:
parent
2504961a33
commit
a3c392cdde
2 changed files with 11 additions and 9 deletions
|
|
@ -4,9 +4,10 @@ import (
|
|||
"bytes"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"sync"
|
||||
|
||||
"github.com/XinFinOrg/XDPoSChain/common"
|
||||
"github.com/XinFinOrg/XDPoSChain/core/rawdb"
|
||||
"sync"
|
||||
|
||||
"github.com/XinFinOrg/XDPoSChain/ethdb"
|
||||
"github.com/XinFinOrg/XDPoSChain/log"
|
||||
|
|
@ -171,13 +172,13 @@ func (db *BatchDatabase) Sync() error {
|
|||
}
|
||||
|
||||
func (db *BatchDatabase) NewIterator(prefix []byte, start []byte) ethdb.Iterator {
|
||||
return db.NewIterator(prefix, start)
|
||||
panic("NewIterator from XDCxDAO leveldb is not supported")
|
||||
}
|
||||
|
||||
func (db *BatchDatabase) Stat(property string) (string, error) {
|
||||
return db.Stat(property)
|
||||
return "", errNotSupported
|
||||
}
|
||||
|
||||
func (db *BatchDatabase) Compact(start []byte, limit []byte) error {
|
||||
return db.Compact(start, limit)
|
||||
return errNotSupported
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ import (
|
|||
"bytes"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/XinFinOrg/XDPoSChain/XDCx/tradingstate"
|
||||
"github.com/XinFinOrg/XDPoSChain/XDCxlending/lendingstate"
|
||||
"github.com/XinFinOrg/XDPoSChain/common"
|
||||
|
|
@ -12,8 +15,6 @@ import (
|
|||
"github.com/globalsign/mgo"
|
||||
"github.com/globalsign/mgo/bson"
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -873,15 +874,15 @@ func (db *MongoDatabase) Sync() error {
|
|||
}
|
||||
|
||||
func (db *MongoDatabase) NewIterator(prefix []byte, start []byte) ethdb.Iterator {
|
||||
return db.NewIterator(prefix, start)
|
||||
panic("NewIterator from XDCxDAO mongodb is not supported")
|
||||
}
|
||||
|
||||
func (db *MongoDatabase) Stat(property string) (string, error) {
|
||||
return db.Stat(property)
|
||||
return "", errNotSupported
|
||||
}
|
||||
|
||||
func (db *MongoDatabase) Compact(start []byte, limit []byte) error {
|
||||
return db.Compact(start, limit)
|
||||
return errNotSupported
|
||||
}
|
||||
|
||||
func (db *MongoDatabase) NewBatch() ethdb.Batch {
|
||||
|
|
|
|||
Loading…
Reference in a new issue