fix accounts len check
This commit is contained in:
@@ -25,6 +25,9 @@ func chainLinkParser(tx *Tx, instruction Instruction, inners InnerInstructions,
|
||||
}
|
||||
|
||||
decode := instruction.Data
|
||||
if len(decode) < 4 {
|
||||
return increaseOffset(offset), nil
|
||||
}
|
||||
discriminator := binary.LittleEndian.Uint32(decode[0:4])
|
||||
|
||||
switch discriminator {
|
||||
@@ -55,6 +58,9 @@ func chainLinkSubmitParser(instruction Instruction, inners InnerInstructions, of
|
||||
if storeInstruction.Accounts[0] >= len(tx.rawTx.accountList) || tx.rawTx.accountList[storeInstruction.Accounts[0]] != chainlinkSOLUSDFeedAccount {
|
||||
return increaseOffset(offset), InstructionIgnoredError
|
||||
}
|
||||
if len(storeInstruction.Data) < 8 {
|
||||
return increaseOffset(offset), InstructionIgnoredError
|
||||
}
|
||||
if !bytes.Equal(storeInstruction.Data[0:8], chainlinkSubmitDiscriminator[:]) {
|
||||
return increaseOffset(offset), InstructionIgnoredError
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user