-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filecoin network query fixes #619
Conversation
src/filecoin/FilecoinEngine.ts
Outdated
@@ -331,6 +331,8 @@ export class FilecoinEngine extends CurrencyEngine< | |||
}): void => { | |||
this.addTransaction(this.currencyInfo.currencyCode, tx) | |||
this.onUpdateTransactions() | |||
this.otherData.knownTxids[tx.txid] = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already an engine.txIdMap
you should use. It's automatically kept up to date by addTransaction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it available after loading the engine? If so, I'll use that instead of the otherData
which does get loaded.
src/filecoin/FilecoinEngine.ts
Outdated
} | ||
// Exit early because we reached transaction history from previous | ||
// check | ||
if (this.otherData.knownTxids[txid]) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
if (this.findTransaction('FIL', normalizeAddress(txid)) !== -1) return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot use this because it's not available after loading the engine.
0b6e0e5
to
16a37e1
Compare
The transaction list data doesn't load until `getTransactions` is called or a new transaction is saved. This means it's not suitable for checking the known txid from prior syncs.
Filfox has a convenient API for retrieving fee info on a message. Filscan doesn't have an known API for getting the fee amounts without figuring out how to calculate the fee amounts from four or five fee related fields on a Filecoin message.
16a37e1
to
4d95709
Compare
Heads up. This disables Filscan because I haven't found a convenient way to calculate fees from Filscan's API. I haven't quit wrapped my head around how Filecoin fees are calculated, so rather than calculating the fee from the message fields, I use a hack to peer into the "transfer" data returned by Filfox.
CHANGELOG
Dependencies
noneDescription
none