Skip to content

RPC receive#142

Merged
clemahieu merged 2 commits intonanocurrency:masterfrom
SergiySW:rpc_receive
Jun 21, 2017
Merged

RPC receive#142
clemahieu merged 2 commits intonanocurrency:masterfrom
SergiySW:rpc_receive

Conversation

@SergiySW
Copy link
Copy Markdown
Contributor

Will be useful if someone send less than threshold, but cumulative > threshold. Such as 99 + 99 > 100 and cannot be received by current exchanges

@clemahieu clemahieu merged commit 0345aa0 into nanocurrency:master Jun 21, 2017
dsiganos added a commit that referenced this pull request Jun 13, 2022
- Limit the vote_processor::flush_active()
- The is_active var became useless, also moved the lock position
- Move the condition.notify_all() up
- Improve function flush documentation
- Test normal behavior is getting more votes than processing
- Also updated the invalid_signature test to ASSERT_TIMELY since it
should wait for a flush to happen.
- Also removed the lock for reading total_processed atomic
variable
- Explicitly check for timeout in unit test vote_processor.overflow
- Vote processor: clear votes and notify condition variable on thread
exit

In theory the vote processor can be stopped and have votes left in its
queue which would just be strange and a potential source of problems.

Also, a final kick of the condition variable is needed on thread exit
and after vote clearing.

- Check for confirm req loop blocking too long on vote process flush

This has been a problem in the past and it is always tricky to do flush
operations, so it is prudent to add a check for timeout here and display
a warning in release and throw an assert in debug builds.

- Use std::memory_order_relaxed in vote processor::flush for
total_processed

There is no need to take a memory barrier when reading the atomic
total_processed, so use relaxed memory order.

Co-Authored-By: Dimitrios Siganos <dimitris@siganos.org>

Co-authored-by: Dimitrios Siganos <dimitris@siganos.org>
pwojcikdev pushed a commit to pwojcikdev/nano-node that referenced this pull request Jun 14, 2022
…y#142)

- Limit the vote_processor::flush_active()
- The is_active var became useless, also moved the lock position
- Move the condition.notify_all() up
- Improve function flush documentation
- Test normal behavior is getting more votes than processing
- Also updated the invalid_signature test to ASSERT_TIMELY since it
should wait for a flush to happen.
- Also removed the lock for reading total_processed atomic
variable
- Explicitly check for timeout in unit test vote_processor.overflow
- Vote processor: clear votes and notify condition variable on thread
exit

In theory the vote processor can be stopped and have votes left in its
queue which would just be strange and a potential source of problems.

Also, a final kick of the condition variable is needed on thread exit
and after vote clearing.

- Check for confirm req loop blocking too long on vote process flush

This has been a problem in the past and it is always tricky to do flush
operations, so it is prudent to add a check for timeout here and display
a warning in release and throw an assert in debug builds.

- Use std::memory_order_relaxed in vote processor::flush for
total_processed

There is no need to take a memory barrier when reading the atomic
total_processed, so use relaxed memory order.

Co-Authored-By: Dimitrios Siganos <dimitris@siganos.org>

Co-authored-by: Dimitrios Siganos <dimitris@siganos.org>
# Conflicts:
#	nano/core_test/vote_processor.cpp
gr0vity-dev pushed a commit to gr0vity-dev/nano-node that referenced this pull request Jul 9, 2022
…y#142)

- Limit the vote_processor::flush_active()
- The is_active var became useless, also moved the lock position
- Move the condition.notify_all() up
- Improve function flush documentation
- Test normal behavior is getting more votes than processing
- Also updated the invalid_signature test to ASSERT_TIMELY since it
should wait for a flush to happen.
- Also removed the lock for reading total_processed atomic
variable
- Explicitly check for timeout in unit test vote_processor.overflow
- Vote processor: clear votes and notify condition variable on thread
exit

In theory the vote processor can be stopped and have votes left in its
queue which would just be strange and a potential source of problems.

Also, a final kick of the condition variable is needed on thread exit
and after vote clearing.

- Check for confirm req loop blocking too long on vote process flush

This has been a problem in the past and it is always tricky to do flush
operations, so it is prudent to add a check for timeout here and display
a warning in release and throw an assert in debug builds.

- Use std::memory_order_relaxed in vote processor::flush for
total_processed

There is no need to take a memory barrier when reading the atomic
total_processed, so use relaxed memory order.

Co-Authored-By: Dimitrios Siganos <dimitris@siganos.org>

Co-authored-by: Dimitrios Siganos <dimitris@siganos.org>
# Conflicts:
#	nano/core_test/vote_processor.cpp
gr0vity-dev pushed a commit to gr0vity-dev/nano-node that referenced this pull request Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants