forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin#14437: Refactor: Start to separate wallet from node
- Loading branch information
1 parent
f2dce0f
commit 6deaf36
Showing
38 changed files
with
786 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) 2018 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <interfaces/chain.h> | ||
|
||
#include <sync.h> | ||
#include <util/system.h> | ||
#include <validation.h> | ||
|
||
#include <memory> | ||
#include <utility> | ||
|
||
namespace interfaces { | ||
namespace { | ||
|
||
class LockImpl : public Chain::Lock | ||
{ | ||
}; | ||
|
||
class LockingStateImpl : public LockImpl, public UniqueLock<CCriticalSection> | ||
{ | ||
using UniqueLock::UniqueLock; | ||
}; | ||
|
||
class ChainImpl : public Chain | ||
{ | ||
public: | ||
std::unique_ptr<Chain::Lock> lock(bool try_lock) override | ||
{ | ||
auto result = MakeUnique<LockingStateImpl>(::cs_main, "cs_main", __FILE__, __LINE__, try_lock); | ||
if (try_lock && result && !*result) return {}; | ||
// std::move necessary on some compilers due to conversion from | ||
// LockingStateImpl to Lock pointer | ||
return std::move(result); | ||
} | ||
std::unique_ptr<Chain::Lock> assumeLocked() override { return MakeUnique<LockImpl>(); } | ||
}; | ||
|
||
} // namespace | ||
|
||
std::unique_ptr<Chain> MakeChain() { return MakeUnique<ChainImpl>(); } | ||
|
||
} // namespace interfaces |
Oops, something went wrong.