node/pkg/solana: silently ignore non-PostMessage transactions

These were already ignored, but loudly.

Change-Id: Ifdd2199593ae372a5f598a018a782db112108f16
This commit is contained in:
Leo 2021-10-01 14:46:20 +02:00
parent 2a1eaf5163
commit d5062af533
1 changed files with 4 additions and 3 deletions

View File

@ -375,14 +375,15 @@ func (s *SolanaWatcher) processInstruction(ctx context.Context, logger *zap.Logg
return false, nil return false, nil
} }
if inst.Data[0] != postMessageInstructionID {
return false, nil
}
if len(inst.Accounts) != postMessageInstructionNumAccounts { if len(inst.Accounts) != postMessageInstructionNumAccounts {
return false, fmt.Errorf("invalid number of accounts: %d instead of %d", return false, fmt.Errorf("invalid number of accounts: %d instead of %d",
len(inst.Accounts), postMessageInstructionNumAccounts) len(inst.Accounts), postMessageInstructionNumAccounts)
} }
if inst.Data[0] != postMessageInstructionID {
return false, fmt.Errorf("invalid postMessage instruction ID, got: %d", inst.Data[0])
}
// Decode instruction data (UNTRUSTED) // Decode instruction data (UNTRUSTED)
var data PostMessageData var data PostMessageData