Wait until bitcoind is stopped in test.
This commit is contained in:
parent
db8cd7fa7e
commit
50c3bc43ab
@ -16,6 +16,10 @@ bitcoind.getBlock(blockHash, function(err, block) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
bitcoind.stop(function(err, result) {
|
||||||
|
// bitcoind is stopped
|
||||||
|
});
|
||||||
|
|
||||||
You can log output from the daemon using:
|
You can log output from the daemon using:
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
|
|||||||
@ -38,6 +38,13 @@ describe('Basic Functionality', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
after(function(done) {
|
||||||
|
this.timeout(20000);
|
||||||
|
bitcoind.stop(function(err, result) {
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('will get correct block data', function() {
|
describe('will get correct block data', function() {
|
||||||
|
|
||||||
blockData.forEach(function(data) {
|
blockData.forEach(function(data) {
|
||||||
|
|||||||
@ -716,6 +716,9 @@ async_stop_node(uv_work_t *req) {
|
|||||||
async_node_data *data = static_cast<async_node_data*>(req->data);
|
async_node_data *data = static_cast<async_node_data*>(req->data);
|
||||||
unhook_packets();
|
unhook_packets();
|
||||||
StartShutdown();
|
StartShutdown();
|
||||||
|
while(!shutdown_complete) {
|
||||||
|
usleep(1E6);
|
||||||
|
}
|
||||||
data->result = std::string("bitcoind shutdown.");
|
data->result = std::string("bitcoind shutdown.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user