Enforce flood threshold in retry and path-prep selection
Ensure MessageRetryService forces flood once the attempt reaches floodFromAttempt even if a selector returns null, and pass SendAttemptPlan.floodFromAttempt from preparePathForContactSend so zero-budget plans keep the saved path.
This commit is contained in:
1 parent
27cc332383
commit
723fa18b68
4 files changed
+308
-13
No files matched your search
@@ -330,15 +330,22 @@ class MessageRetryService extends ChangeNotifier {
|
||||
return null;
|
||||
}
|
||||
|
||||
final floodFrom = plan.floodFromAttempt;
|
||||
final recentSelections = List<PathSelection>.from(
|
||||
_attemptPathHistory[message.messageId] ?? const <PathSelection>[],
|
||||
);
|
||||
return config.selectRetryPath!(
|
||||
final selection = config.selectRetryPath!(
|
||||
contact.publicKeyHex,
|
||||
message.retryCount,
|
||||
plan.floodFromAttempt ?? (1 << 30),
|
||||
floodFrom ?? (1 << 30),
|
||||
recentSelections,
|
||||
);
|
||||
if (floodFrom != null && message.retryCount >= floodFrom) {
|
||||
return selection != null && selection.useFlood
|
||||
? selection
|
||||
: const PathSelection(pathBytes: [], hopCount: -1, useFlood: true);
|
||||
}
|
||||
return selection;
|
||||
}
|
||||
|
||||
void _recordAttemptPathHistory(String messageId, PathSelection selection) {
|
||||
|
||||
Reference in new issue
Block a user