@@ -139,15 +139,20 @@ abstract contract ManagerBase is
139
139
bytes32 nttManagerMessageHash =
140
140
TransceiverStructs.nttManagerMessageDigest (sourceChainId, payload);
141
141
142
+ // The `msg.sender` is the transceiver. Get the index for it.
143
+ uint8 index = _getTransceiverInfosStorage ()[msg .sender ].index;
144
+
145
+ // If this transceiver is not enabled for this chain, ignore this attestation.
146
+ // TODO: Is there a race condition with disabling a transceiver while a tx is outstanding?
147
+ if (! _isRecvTransceiverEnabledForChain (sourceChainId, index)) {
148
+ return nttManagerMessageHash;
149
+ }
150
+
142
151
// set the attested flag for this transceiver.
143
152
// NOTE: Attestation is idempotent (bitwise or 1), but we revert
144
153
// anyway to ensure that the client does not continue to initiate calls
145
154
// to receive the same message through the same transceiver.
146
- if (
147
- transceiverAttestedToMessage (
148
- nttManagerMessageHash, _getTransceiverInfosStorage ()[msg .sender ].index
149
- )
150
- ) {
155
+ if (transceiverAttestedToMessage (nttManagerMessageHash, index)) {
151
156
revert TransceiverAlreadyAttestedToMessage (nttManagerMessageHash);
152
157
}
153
158
_setTransceiverAttestedToMessage (nttManagerMessageHash, msg .sender );
@@ -225,7 +230,7 @@ abstract contract ManagerBase is
225
230
)
226
231
{
227
232
// cache enabled transceivers to avoid multiple storage reads
228
- address [] memory enabledTransceivers = _getEnabledTransceiversStorage ( );
233
+ address [] memory enabledTransceivers = getEnabledSendTransceiversForChain (recipientChain );
229
234
230
235
TransceiverStructs.TransceiverInstruction[] memory instructions;
231
236
0 commit comments