Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import (
"runtime"
"strings"

"github.com/XinFinOrg/XDPoSChain/common"
"github.com/XinFinOrg/XDPoSChain/internal/build"
)

Expand Down Expand Up @@ -79,7 +80,7 @@ func executablePath(name string) string {
func main() {
log.SetFlags(log.Lshortfile)

if _, err := os.Stat(filepath.Join("build", "ci.go")); os.IsNotExist(err) {
if !common.FileExist(filepath.Join("build", "ci.go")) {
log.Fatal("this script must be run from the root of the repository")
}
if len(os.Args) < 2 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
if ctx.IsSet(StoreRewardFlag.Name) {
common.StoreRewardFolder = filepath.Join(stack.DataDir(), "XDC", "rewards")
if _, err := os.Stat(common.StoreRewardFolder); os.IsNotExist(err) {
if !common.FileExist(common.StoreRewardFolder) {
os.Mkdir(common.StoreRewardFolder, os.ModePerm)
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/txpool/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func newTxJournal(path string) *journal {
// the specified pool.
func (journal *journal) load(add func([]*types.Transaction) []error) error {
// Skip the parsing if the journal file doens't exist at all
if _, err := os.Stat(journal.path); os.IsNotExist(err) {
if !common.FileExist(journal.path) {
return nil
}
// Open the journal for loading any past transactions
Expand Down
2 changes: 1 addition & 1 deletion core/txpool/lending_tx_journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func newLendingTxJournal(path string) *lendingtxJournal {
// the specified pool.
func (journal *lendingtxJournal) load(add func(*types.LendingTransaction) error) error {
// Skip the parsing if the journal file doens't exist at all
if _, err := os.Stat(journal.path); os.IsNotExist(err) {
if !common.FileExist(journal.path) {
return nil
}
// Open the journal for loading any past transactions
Expand Down
2 changes: 1 addition & 1 deletion core/txpool/order_tx_journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func newOrderTxJournal(path string) *ordertxJournal {
// the specified pool.
func (journal *ordertxJournal) load(add func(*types.OrderTransaction) error) error {
// Skip the parsing if the journal file doens't exist at all
if _, err := os.Stat(journal.path); os.IsNotExist(err) {
if !common.FileExist(journal.path) {
return nil
}
// Open the journal for loading any past transactions
Expand Down