diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-04-02 14:20:51 +0100 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-04-02 14:20:51 +0100 |
| commit | 087373eccff1d651165baeae6ac1b0049faff53f (patch) | |
| tree | 7665d0bdd32258f9848f206815537acb8e5ac92f | |
| parent | e7c8a32a288b9e5d82da09c8e077f7ed0e440fec (diff) | |
| download | monzero-core-087373eccff1d651165baeae6ac1b0049faff53f.tar.gz monzero-core-087373eccff1d651165baeae6ac1b0049faff53f.tar.xz monzero-core-087373eccff1d651165baeae6ac1b0049faff53f.zip | |
Fix potential race with parallel processing of txes/signatures/blocks
| -rw-r--r-- | src/cryptonote_core/blockchain.cpp | 1 | ||||
| -rw-r--r-- | src/wallet/wallet2.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 34810d983..dd4e9d14d 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2159,6 +2159,7 @@ bool Blockchain::check_tx_inputs(const transaction& tx, tx_verification_context if(ioservice_active) \ { \ work.reset(); \ + while (!ioservice.stopped()) ioservice.poll(); \ threadpool.join_all(); \ ioservice.stop(); \ ioservice_active = false; \ diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index a9a65535f..34bbd9fd2 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -73,6 +73,7 @@ using namespace cryptonote; #define KILL_IOSERVICE() \ do { \ work.reset(); \ + while (!ioservice.stopped()) ioservice.poll(); \ threadpool.join_all(); \ ioservice.stop(); \ } while(0) |
