mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 12:45:20 +00:00
add pow
This commit is contained in:
@@ -1156,6 +1156,16 @@ class NostrGeohashService(
|
||||
return@launch
|
||||
}
|
||||
|
||||
// Check Proof of Work validation BEFORE other processing
|
||||
val powSettings = PoWPreferenceManager.getCurrentSettings()
|
||||
if (powSettings.enabled && powSettings.difficulty > 0) {
|
||||
if (!NostrProofOfWork.validateDifficulty(event, powSettings.difficulty)) {
|
||||
Log.w(TAG, "🚫 Rejecting geohash event ${event.id.take(8)}... due to insufficient PoW (required: ${powSettings.difficulty})")
|
||||
return@launch
|
||||
}
|
||||
Log.v(TAG, "✅ PoW validation passed for event ${event.id.take(8)}...")
|
||||
}
|
||||
|
||||
// Check if this user is blocked in geohash channels BEFORE any processing
|
||||
if (isGeohashUserBlocked(event.pubkey)) {
|
||||
Log.v(TAG, "🚫 Skipping event from blocked geohash user: ${event.pubkey.take(8)}...")
|
||||
|
||||
Reference in New Issue
Block a user