Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Transaction history stops updating after 100 addresses are generated #741

Open
wraithm opened this issue Dec 21, 2017 · 3 comments
Open

Comments

@wraithm
Copy link

wraithm commented Dec 21, 2017

I noticed that the /tx_history endpoint stopped adding new events after having generated many addresses in my copay wallet. The balance and utxo endpoints were fine. Those showed the new events just fine. I narrowed it down to not querying the blockchain explorer after 100 addresses were generated. The useCache variable is set to true in my case, and if you follow the code, you see that querying the blockchain for new updates gets skipped if the cache is queried.

Look at the getNormalizedTxs function in getTxHistory:
https://github.com/bitpay/bitcore-wallet-service/blob/master/lib/server.js#L3126

It seems that even if the cache is queried for old transactions, the newer transactions still need to be queried. You need some sort of logic that queries the blockchain after some certain height or something like that.

@wraithm
Copy link
Author

wraithm commented Dec 21, 2017

@matiu What do you think about this?

@WeijiaChe
Copy link

Hitting the same bug here

@WeijiaChe
Copy link

@matiu shouldn't this line
https://github.com/bitpay/bitcore-wallet-service/blob/master/lib/server.js#L3168
var useCache = addresses.length >= Defaults.HISTORY_CACHE_ADDRESS_THRESOLD;
be
var useCache = addresses.length <= Defaults.HISTORY_CACHE_ADDRESS_THRESOLD;

Tagging a bit more people for raising awareness since the original conversation got no response back
@michaelsdunn1 @isocolsky @troggy @Gamboster

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants