diff options
Diffstat (limited to 'src/consensus/plugin_block_consensus.c')
-rw-r--r-- | src/consensus/plugin_block_consensus.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/consensus/plugin_block_consensus.c b/src/consensus/plugin_block_consensus.c index 39e348b18..3ad335760 100644 --- a/src/consensus/plugin_block_consensus.c +++ b/src/consensus/plugin_block_consensus.c | |||
@@ -35,6 +35,7 @@ | |||
35 | * request evaluation, simply pass "NULL" for the reply_block. | 35 | * request evaluation, simply pass "NULL" for the reply_block. |
36 | * | 36 | * |
37 | * @param cls closure | 37 | * @param cls closure |
38 | * @param ctx context | ||
38 | * @param type block type | 39 | * @param type block type |
39 | * @param group block group to use | 40 | * @param group block group to use |
40 | * @param eo control flags | 41 | * @param eo control flags |
@@ -47,6 +48,7 @@ | |||
47 | */ | 48 | */ |
48 | static enum GNUNET_BLOCK_EvaluationResult | 49 | static enum GNUNET_BLOCK_EvaluationResult |
49 | block_plugin_consensus_evaluate (void *cls, | 50 | block_plugin_consensus_evaluate (void *cls, |
51 | struct GNUNET_BLOCK_Context *ctx, | ||
50 | enum GNUNET_BLOCK_Type type, | 52 | enum GNUNET_BLOCK_Type type, |
51 | struct GNUNET_BLOCK_Group *group, | 53 | struct GNUNET_BLOCK_Group *group, |
52 | enum GNUNET_BLOCK_EvaluationOptions eo, | 54 | enum GNUNET_BLOCK_EvaluationOptions eo, |
@@ -57,10 +59,23 @@ block_plugin_consensus_evaluate (void *cls, | |||
57 | size_t reply_block_size) | 59 | size_t reply_block_size) |
58 | { | 60 | { |
59 | if (reply_block_size < sizeof (struct ConsensusElement)) | 61 | if (reply_block_size < sizeof (struct ConsensusElement)) |
60 | { | ||
61 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 62 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
62 | } | 63 | |
63 | return GNUNET_BLOCK_EVALUATION_OK_MORE; | 64 | const struct ConsensusElement *ce = reply_block; |
65 | |||
66 | if ( (GNUNET_YES == ce->is_contested_marker) || | ||
67 | (0 == ce->payload_type ) ) | ||
68 | return GNUNET_BLOCK_EVALUATION_OK_MORE; | ||
69 | |||
70 | return GNUNET_BLOCK_evaluate (ctx, | ||
71 | type, | ||
72 | group, | ||
73 | eo, | ||
74 | query, | ||
75 | xquery, | ||
76 | xquery_size, | ||
77 | &ce[1], | ||
78 | reply_block_size - sizeof (struct ConsensusElement)); | ||
64 | } | 79 | } |
65 | 80 | ||
66 | 81 | ||