From 15aa8e525398beb0e6ecb03b904efdcf1239c268 Mon Sep 17 00:00:00 2001 From: zgfzgf <1901989065@qq.com> Date: Wed, 25 Nov 2020 12:58:17 +0800 Subject: [PATCH 1/2] fix wallet dead lock --- chain/wallet/wallet.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/chain/wallet/wallet.go b/chain/wallet/wallet.go index 46ff92861..8d074a117 100644 --- a/chain/wallet/wallet.go +++ b/chain/wallet/wallet.go @@ -6,18 +6,16 @@ import ( "strings" "sync" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/crypto" logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/api" - _ "github.com/filecoin-project/lotus/lib/sigs/bls" // enable bls signatures - _ "github.com/filecoin-project/lotus/lib/sigs/secp" // enable secp signatures - "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/lib/sigs" + _ "github.com/filecoin-project/lotus/lib/sigs/bls" // enable bls signatures + _ "github.com/filecoin-project/lotus/lib/sigs/secp" // enable secp signatures ) var log = logging.Logger("wallet") @@ -270,7 +268,7 @@ func (w *LocalWallet) WalletHas(ctx context.Context, addr address.Address) (bool return k != nil, nil } -func (w *LocalWallet) WalletDelete(ctx context.Context, addr address.Address) error { +func (w *LocalWallet) walletDelete(ctx context.Context, addr address.Address) error { k, err := w.findKey(addr) if err != nil { @@ -305,6 +303,14 @@ func (w *LocalWallet) WalletDelete(ctx context.Context, addr address.Address) er delete(w.keys, addr) + return nil +} + +func (w *LocalWallet) WalletDelete(ctx context.Context, addr address.Address) error { + if err := w.walletDelete(ctx, addr); err != nil { + return xerrors.Errorf("wallet delete: %w", err) + } + def, err := w.GetDefault() if err != nil { return xerrors.Errorf("getting default address: %w", err) From 506624f509284fa9f09832225044f4f451735a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 26 Nov 2020 11:42:19 +0100 Subject: [PATCH 2/2] Update go-jsonrpc to v0.1.2 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 259eee673..b4a9eba65 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/filecoin-project/go-data-transfer v1.2.0 github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a github.com/filecoin-project/go-fil-markets v1.0.6 - github.com/filecoin-project/go-jsonrpc v0.1.2-0.20201116213214-f4b2d34247f0 + github.com/filecoin-project/go-jsonrpc v0.1.2 github.com/filecoin-project/go-multistore v0.0.3 github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20 github.com/filecoin-project/go-paramfetch v0.0.2-0.20200701152213-3e0f0afdc261 diff --git a/go.sum b/go.sum index 9b0cc0fe0..fa0fe5387 100644 --- a/go.sum +++ b/go.sum @@ -271,8 +271,8 @@ github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CW github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24= github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 h1:b3UDemBYN2HNfk3KOXNuxgTTxlWi3xVvbQP0IT38fvM= github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0/go.mod h1:7aWZdaQ1b16BVoQUYR+eEvrDCGJoPLxFpDynFjYfBjI= -github.com/filecoin-project/go-jsonrpc v0.1.2-0.20201116213214-f4b2d34247f0 h1:kCIWv46+RUz45DfQdBTaYOmduwN/iH4dghYDTcyCgg4= -github.com/filecoin-project/go-jsonrpc v0.1.2-0.20201116213214-f4b2d34247f0/go.mod h1:XBBpuKIMaXIIzeqzO1iucq4GvbF8CxmXRFoezRh+Cx4= +github.com/filecoin-project/go-jsonrpc v0.1.2 h1:MTebUawBHLxxY9gDi1WXuGc89TWIDmsgoDqeZSk9KRw= +github.com/filecoin-project/go-jsonrpc v0.1.2/go.mod h1:XBBpuKIMaXIIzeqzO1iucq4GvbF8CxmXRFoezRh+Cx4= github.com/filecoin-project/go-multistore v0.0.3 h1:vaRBY4YiA2UZFPK57RNuewypB8u0DzzQwqsL0XarpnI= github.com/filecoin-project/go-multistore v0.0.3/go.mod h1:kaNqCC4IhU4B1uyr7YWFHd23TL4KM32aChS0jNkyUvQ= github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20 h1:+/4aUeUoKr6AKfPE3mBhXA5spIV6UcKdTYDPNU2Tdmg=