[wallet] GetTransfersByAddress for preloaded transfers

This commit is contained in:
Roman Volosovskyi 2021-03-16 15:49:32 +02:00
parent d22182ea82
commit 04fb7fdb3d
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
0.73.9
0.73.10

View File

@ -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