Protect wallet data file with a file lock

Operations on the wallet data file are now fenced by a lock to
avoid potentially messy concurrent modifications by multiple
processes (i.e. the wallet receiver and a send command). The lock
is done using a create-only lock file, which is an atomic
operation.
This commit is contained in:
Ignotus Peverell
2017-06-14 21:42:58 -07:00
parent 6523966f9e
commit fbbd703e99
5 changed files with 129 additions and 92 deletions
-1
View File
@@ -114,7 +114,6 @@ impl<T> TransactionPool<T> where T: BlockChain {
// Making sure the transaction is valid before anything else.
let secp = secp::Secp256k1::with_caps(secp::ContextFlag::Commit);
tx.validate(&secp).map_err(|_| PoolError::Invalid)?;
// The first check invovles ensuring that an identical transaction is
// not already in the pool's transaction set.