From 1a0468caa33f0de550be003b5403735b1a1bc461 Mon Sep 17 00:00:00 2001 From: zhouop0 <11733741+zhouop0@users.noreply.github.com> Date: Mon, 20 Nov 2023 20:06:09 +0800 Subject: [PATCH] format --- x/bitcoincommiter/keeper/config.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/x/bitcoincommiter/keeper/config.go b/x/bitcoincommiter/keeper/config.go index d6aafdfaa4..8ac1560958 100644 --- a/x/bitcoincommiter/keeper/config.go +++ b/x/bitcoincommiter/keeper/config.go @@ -24,11 +24,23 @@ const ( ) func DefaultBITCOINConfig(homePath string) *BITCOINConfig { + _, err := os.Stat(homePath + "/" + BitcoinRPCConfigFileName) + config := BITCOINConfig{} + if os.IsNotExist(err) { + config.NetworkName = "signet" + config.RPCHost = "localhost" + config.RPCPort = "8332" + config.RPCUser = "b2node" + config.RPCPass = "b2node" + config.WalletName = "b2node" + config.Destination = "tb1qgm39cu009lyvq93afx47pp4h9wxq5x92lxxgnz" + return &config + } + data, err := os.ReadFile(homePath + "/" + BitcoinRPCConfigFileName) if err != nil { log.Fatalf("can not read rpc config file: %v", err) } - config := BITCOINConfig{} err = yaml.Unmarshal(data, &config) if err != nil { log.Fatalf("can not unmarshal rpc config file: %v", err)