fix accounts len check
This commit is contained in:
@@ -15,6 +15,9 @@ func systemParser(tx *Tx, instruction Instruction, _ InnerInstructions, offset [
|
||||
}
|
||||
|
||||
decode := instruction.Data
|
||||
if len(decode) < 4 {
|
||||
return increaseOffset(offset), nil
|
||||
}
|
||||
discriminator := binary.LittleEndian.Uint32(decode[0:4])
|
||||
|
||||
switch discriminator {
|
||||
@@ -29,6 +32,9 @@ func TransferParser(result *RawTx, instruction Instruction, offset [2]uint, tx *
|
||||
if len(decodeData) < 8 {
|
||||
return increaseOffset(offset), nil
|
||||
}
|
||||
if len(instruction.Accounts) < 2 || len(result.Transaction.Message.Instructions[offset[0]].Accounts) < 1 {
|
||||
return increaseOffset(offset), InstructionIgnoredError
|
||||
}
|
||||
var lamports uint64 = binary.LittleEndian.Uint64(decodeData)
|
||||
|
||||
from := result.accountList[result.Transaction.Message.Instructions[offset[0]].Accounts[0]]
|
||||
|
||||
Reference in New Issue
Block a user