From 04fb7fdb3d62e4b26cc33d6e2d6182c4b358a0f8 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Tue, 16 Mar 2021 15:49:32 +0200 Subject: [PATCH] [wallet] GetTransfersByAddress for preloaded transfers --- VERSION | 2 +- services/wallet/api.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index be67ff955..04a4831df 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.73.9 +0.73.10 diff --git a/services/wallet/api.go b/services/wallet/api.go index 2ab7d83ff..d82f13304 100644 --- a/services/wallet/api.go +++ b/services/wallet/api.go @@ -30,7 +30,7 @@ func (api *API) SetInitialBlocksRange(ctx context.Context) error { } // GetTransfersByAddress returns transfers for a single address -func (api *API) GetTransfersByAddress(ctx context.Context, address common.Address, toBlock, limit *hexutil.Big) ([]TransferView, error) { +func (api *API) GetTransfersByAddress(ctx context.Context, address common.Address, toBlock, limit *hexutil.Big, fetchMore bool) ([]TransferView, error) { log.Debug("[WalletAPI:: GetTransfersByAddress] get transfers for an address", "address", address, "block", toBlock, "limit", limit) if api.s.db == nil { log.Error("[WalletAPI:: GetTransfersByAddress] db is not initialized") @@ -49,7 +49,7 @@ func (api *API) GetTransfersByAddress(ctx context.Context, address common.Addres } transfersCount := big.NewInt(int64(len(rst))) - if limit.ToInt().Cmp(transfersCount) == 1 { + if fetchMore && limit.ToInt().Cmp(transfersCount) == 1 { block, err := api.s.db.GetFirstKnownBlock(address) if err != nil { return nil, err