Skip to content

Commit

Permalink
pindexer: don't index transactions with no actions
Browse files Browse the repository at this point in the history
There are a few of these on mainnet before we added the check,
and they yield the same transaction ID. These are completely uninteresting
transactions which have no effect on any state on the chain,
and we should ignore them. Other transactions should be unique.
  • Loading branch information
cronokirby committed Feb 20, 2025
1 parent 39173c4 commit d0f566d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/bin/pindexer/src/dex_ex/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1407,14 +1407,17 @@ impl Component {
transaction_id: [u8; 32],
transaction: Transaction,
) -> anyhow::Result<()> {
if transaction.transaction_body.actions.is_empty() {
return Ok(());
}
sqlx::query(
"INSERT INTO dex_ex_transactions (
transaction_id,
transaction,
height,
time
) VALUES ($1, $2, $3, $4)
ON CONFLICT (transaction_id) DO NOTHING",
",
)
.bind(transaction_id)
.bind(transaction.encode_to_vec())
Expand Down

0 comments on commit d0f566d

Please sign in to comment.