Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: await result of receiving blocks (#213)
`bitswap._receiveMessage` is an async function so you need to `await` on it in order to correctly handle any errors encountered. I've been seeing `unhandledPromiseRejection` events during test runs, turns out it's when you spin up two nodes, get them to dial each other and transfer data - the tests can shut the nodes down and clean up their repos before they've finished processing incoming blocks leading to `Error: ENOENT: no such file or directory` errors as the repos are deleted out from under the blockstore. `await`ing on the result of `bitswap._receiveMessage` fixes this by handling the error.
- Loading branch information