mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00
[DEV-115] Make sure BTCD Node runs
* [DEV-115] fix mistype mainCfg -> cfg in config/config.go * [DEV-115] add config log
This commit is contained in:
parent
86feb42cc4
commit
85265e1d9b
@ -24,12 +24,13 @@ import (
|
|||||||
"github.com/daglabs/btcd/dagconfig"
|
"github.com/daglabs/btcd/dagconfig"
|
||||||
"github.com/daglabs/btcd/dagconfig/daghash"
|
"github.com/daglabs/btcd/dagconfig/daghash"
|
||||||
"github.com/daglabs/btcd/database"
|
"github.com/daglabs/btcd/database"
|
||||||
|
_ "github.com/daglabs/btcd/database/ffldb"
|
||||||
"github.com/daglabs/btcd/logger"
|
"github.com/daglabs/btcd/logger"
|
||||||
"github.com/daglabs/btcd/mempool"
|
"github.com/daglabs/btcd/mempool"
|
||||||
"github.com/daglabs/btcd/version"
|
|
||||||
"github.com/daglabs/btcd/wire"
|
|
||||||
"github.com/daglabs/btcd/util"
|
"github.com/daglabs/btcd/util"
|
||||||
"github.com/daglabs/btcd/util/network"
|
"github.com/daglabs/btcd/util/network"
|
||||||
|
"github.com/daglabs/btcd/version"
|
||||||
|
"github.com/daglabs/btcd/wire"
|
||||||
flags "github.com/jessevdk/go-flags"
|
flags "github.com/jessevdk/go-flags"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -491,7 +492,7 @@ func loadConfig() (*Config, []string, error) {
|
|||||||
|
|
||||||
// Initialize log rotation. After log rotation has been initialized, the
|
// Initialize log rotation. After log rotation has been initialized, the
|
||||||
// logger variables may be used.
|
// logger variables may be used.
|
||||||
logger.InitLogRotator(filepath.Join(mainCfg.LogDir, defaultLogFilename))
|
logger.InitLogRotator(filepath.Join(cfg.LogDir, defaultLogFilename))
|
||||||
|
|
||||||
// Parse, validate, and set debug log level(s).
|
// Parse, validate, and set debug log level(s).
|
||||||
if err := logger.ParseAndSetDebugLevels(cfg.DebugLevel); err != nil {
|
if err := logger.ParseAndSetDebugLevels(cfg.DebugLevel); err != nil {
|
||||||
|
@ -7,6 +7,7 @@ package ffldb
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -24,8 +25,8 @@ import (
|
|||||||
"github.com/daglabs/btcd/dagconfig/daghash"
|
"github.com/daglabs/btcd/dagconfig/daghash"
|
||||||
"github.com/daglabs/btcd/database"
|
"github.com/daglabs/btcd/database"
|
||||||
"github.com/daglabs/btcd/database/internal/treap"
|
"github.com/daglabs/btcd/database/internal/treap"
|
||||||
"github.com/daglabs/btcd/wire"
|
|
||||||
"github.com/daglabs/btcd/util"
|
"github.com/daglabs/btcd/util"
|
||||||
|
"github.com/daglabs/btcd/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -633,7 +634,7 @@ func (b *bucket) CreateBucket(key []byte) (database.Bucket, error) {
|
|||||||
// Ensure bucket does not already exist.
|
// Ensure bucket does not already exist.
|
||||||
bidxKey := bucketIndexKey(b.id, key)
|
bidxKey := bucketIndexKey(b.id, key)
|
||||||
if b.tx.hasKey(bidxKey) {
|
if b.tx.hasKey(bidxKey) {
|
||||||
str := "bucket already exists"
|
str := fmt.Sprintf("bucket %v already exists", hex.EncodeToString(bidxKey))
|
||||||
return nil, makeDbErr(database.ErrBucketExists, str, nil)
|
return nil, makeDbErr(database.ErrBucketExists, str, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ var subsystemLoggers = map[string]btclog.Logger{
|
|||||||
SubsystemTags.SRVR: srvrLog,
|
SubsystemTags.SRVR: srvrLog,
|
||||||
SubsystemTags.SYNC: syncLog,
|
SubsystemTags.SYNC: syncLog,
|
||||||
SubsystemTags.TXMP: txmpLog,
|
SubsystemTags.TXMP: txmpLog,
|
||||||
|
SubsystemTags.CNFG: cnfgLog,
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitLogRotator initializes the logging rotater to write logs to logFile and
|
// InitLogRotator initializes the logging rotater to write logs to logFile and
|
||||||
|
@ -4184,6 +4184,7 @@ func NewRPCServer(
|
|||||||
AddrIndex: p2pServer.AddrIndex,
|
AddrIndex: p2pServer.AddrIndex,
|
||||||
CfIndex: p2pServer.CfIndex,
|
CfIndex: p2pServer.CfIndex,
|
||||||
FeeEstimator: p2pServer.FeeEstimator,
|
FeeEstimator: p2pServer.FeeEstimator,
|
||||||
|
DAG: p2pServer.DAG,
|
||||||
}
|
}
|
||||||
rpc := Server{
|
rpc := Server{
|
||||||
cfg: *cfg,
|
cfg: *cfg,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user