Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

microwavedcola1
Copy link
Contributor

Signed-off-by: microwavedcola1 [email protected]

const sigs = await connection.getConfirmedSignaturesForAddress2(
destinationAta,
);
for (const sig of sigs.slice(0, 10)) {
Copy link
Contributor Author

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?

@microwavedcola1 microwavedcola1 force-pushed the mc/reimburse branch 3 times, most recently from 4fef71d to 0e0ff48 Compare October 13, 2022 12:44
const meta = await connection.getParsedTransaction(
sig.signature,
'confirmed',
);
Copy link
Contributor

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], {
Copy link
Contributor

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants