mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 12:44:19 +01:00
Hotfix: Prevent ZMQ-based bitcoin wallet to panic (#383)
* Hotfix bct embedded wallet w/ ZMQ * Fixes
This commit is contained in:
committed by
GitHub
parent
0d2db92173
commit
247c8bcadf
@@ -226,7 +226,7 @@ func WithPollingBitcoind(host, user, pass string) WalletOption {
|
||||
User: bitcoindConfig.User,
|
||||
Pass: bitcoindConfig.Pass,
|
||||
},
|
||||
"CONSERVATIVE",
|
||||
"ECONOMICAL",
|
||||
chainfee.AbsoluteFeePerKwFloor,
|
||||
)
|
||||
if err != nil {
|
||||
@@ -298,6 +298,27 @@ func WithBitcoindZMQ(block, tx string, host, user, pass string) WalletOption {
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
estimator, err := chainfee.NewBitcoindEstimator(
|
||||
rpcclient.ConnConfig{
|
||||
Host: bitcoindConfig.Host,
|
||||
User: bitcoindConfig.User,
|
||||
Pass: bitcoindConfig.Pass,
|
||||
},
|
||||
"ECONOMICAL",
|
||||
chainfee.AbsoluteFeePerKwFloor,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create bitcoind fee estimator: %w", err)
|
||||
}
|
||||
|
||||
if err := withExtraAPI(&bitcoindRPCClient{chainClient})(s); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := withFeeEstimator(estimator)(s); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := withChainSource(chainClient)(s); err != nil {
|
||||
chainClient.Stop()
|
||||
bitcoindConn.Stop()
|
||||
|
||||
Reference in New Issue
Block a user