-
Notifications
You must be signed in to change notification settings - Fork 69
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
reimburse: ensure ata, ensure not transferred in last 10 txs, transfer #118
base: main
Are you sure you want to change the base?
Conversation
b4c9911
to
510803c
Compare
src/scripts/reimburse.ts
Outdated
const sigs = await connection.getConfirmedSignaturesForAddress2( | ||
destinationAta, | ||
); | ||
for (const sig of sigs.slice(0, 10)) { |
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.
are past 10 good enough?
4fef71d
to
0e0ff48
Compare
Signed-off-by: microwavedcola1 <[email protected]>
0e0ff48
to
f816631
Compare
const meta = await connection.getParsedTransaction( | ||
sig.signature, | ||
'confirmed', | ||
); |
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.
Only looking at a limited set of tx in the past sounds unsafe. I don't know how to do this well though, maybe we store which addresses we've tried to deal with and if we need to rerun we check all tx back to a certain start-slot for our source address and filter out candidates that way?
); | ||
|
||
// Send and confirm | ||
const sig = await sendAndConfirmTransaction(connection, tx, [PAYER], { |
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.
sending lots and lots of tx is something that's done well in the solana program deploy
cli tool. Honestly, I'd borrow that. They know how to send and resend thousands of tx safely and in a timely manner.
Signed-off-by: microwavedcola1 <[email protected]>
52880e5
to
d4a4f04
Compare
Signed-off-by: microwavedcola1 [email protected]