parallel parsing
This commit is contained in:
@@ -11,7 +11,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
dflowProgramID = solana.MustPublicKeyFromBase58("DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH")
|
||||
dflowProgramID = solana.MustPublicKeyFromBase58("DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH")
|
||||
dflowProgramString = dflowProgramID.String()
|
||||
|
||||
dflowSwapDisc = []byte{248, 198, 158, 145, 225, 117, 135, 200}
|
||||
dflowSwap2Disc = []byte{65, 75, 63, 76, 235, 91, 91, 136}
|
||||
@@ -276,10 +277,11 @@ func parseDFlowInstruction(tx *versionedTransaction, instructionIndex int) (*TxS
|
||||
var (
|
||||
srcIdx uint8
|
||||
)
|
||||
for i, acctIdx := range ix.Accounts {
|
||||
if i < 6 {
|
||||
continue
|
||||
}
|
||||
if len(ix.Accounts) <= 6 {
|
||||
return nil, nil
|
||||
}
|
||||
accounts := ix.Accounts[5:]
|
||||
for i, acctIdx := range accounts {
|
||||
key, err := getStaticKey(tx.Message.StaticAccountKeys, int(acctIdx))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -289,15 +291,15 @@ func parseDFlowInstruction(tx *versionedTransaction, instructionIndex int) (*TxS
|
||||
break
|
||||
}
|
||||
}
|
||||
if srcIdx == 0 || srcIdx+1 >= uint8(len(ix.Accounts)) {
|
||||
if srcIdx == 0 || srcIdx+1 >= uint8(len(accounts)) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
baseMint, err := getStaticKey(tx.Message.StaticAccountKeys, int(ix.Accounts[srcIdx]))
|
||||
baseMint, err := getStaticKey(tx.Message.StaticAccountKeys, int(accounts[srcIdx]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
quoteMint, err := getStaticKey(tx.Message.StaticAccountKeys, int(ix.Accounts[srcIdx+1]))
|
||||
quoteMint, err := getStaticKey(tx.Message.StaticAccountKeys, int(accounts[srcIdx+1]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -307,7 +309,6 @@ func parseDFlowInstruction(tx *versionedTransaction, instructionIndex int) (*TxS
|
||||
|
||||
// Build TxSignal
|
||||
sig := &TxSignal{
|
||||
Label: "dflow",
|
||||
TxHash: tx.Signatures[0].String(),
|
||||
Maker: tx.Message.StaticAccountKeys[0].String(),
|
||||
Program: "PumpAMM",
|
||||
|
||||
Reference in New Issue
Block a user