wallet: add GetExternalSigner()
This commit is contained in:
3 files changed
+26
No files matched your search
@@ -33,4 +33,14 @@ bool ExternalSignerScriptPubKeyMan::SetupDescriptor(std::unique_ptr<Descriptor>
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExternalSigner ExternalSignerScriptPubKeyMan::GetExternalSigner() {
|
||||||
|
const std::string command = gArgs.GetArg("-signer", "");
|
||||||
|
if (command == "") throw std::runtime_error(std::string(__func__) + ": restart bitcoind with -signer=<cmd>");
|
||||||
|
std::vector<ExternalSigner> signers;
|
||||||
|
ExternalSigner::Enumerate(command, signers, Params().NetworkIDString());
|
||||||
|
if (signers.empty()) throw std::runtime_error(std::string(__func__) + ": No external signers found");
|
||||||
|
// TODO: add fingerprint argument in case of multiple signers
|
||||||
|
return signers[0];
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -3573,6 +3573,19 @@ void ReserveDestination::ReturnDestination()
|
|||||||
address = CNoDestination();
|
address = CNoDestination();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
|
ExternalSigner CWallet::GetExternalSigner()
|
||||||
|
{
|
||||||
|
const std::string command = gArgs.GetArg("-signer", "");
|
||||||
|
if (command == "") throw std::runtime_error(std::string(__func__) + ": restart bitcoind with -signer=<cmd>");
|
||||||
|
std::vector<ExternalSigner> signers;
|
||||||
|
ExternalSigner::Enumerate(command, signers, Params().NetworkIDString());
|
||||||
|
if (signers.empty()) throw std::runtime_error(std::string(__func__) + ": No external signers found");
|
||||||
|
// TODO: add fingerprint argument in case of multiple signers
|
||||||
|
return signers[0];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void CWallet::LockCoin(const COutPoint& output)
|
void CWallet::LockCoin(const COutPoint& output)
|
||||||
{
|
{
|
||||||
AssertLockHeld(cs_wallet);
|
AssertLockHeld(cs_wallet);
|
||||||
|
|||||||
@@ -839,6 +839,9 @@ public:
|
|||||||
|
|
||||||
std::vector<OutputGroup> GroupOutputs(const std::vector<COutput>& outputs, bool separate_coins, const CFeeRate& effective_feerate, const CFeeRate& long_term_feerate, const CoinEligibilityFilter& filter, bool positive_only) const;
|
std::vector<OutputGroup> GroupOutputs(const std::vector<COutput>& outputs, bool separate_coins, const CFeeRate& effective_feerate, const CFeeRate& long_term_feerate, const CoinEligibilityFilter& filter, bool positive_only) const;
|
||||||
|
|
||||||
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
|
ExternalSigner GetExternalSigner() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
|
#endif
|
||||||
bool IsLockedCoin(uint256 hash, unsigned int n) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
bool IsLockedCoin(uint256 hash, unsigned int n) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
void LockCoin(const COutPoint& output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
void LockCoin(const COutPoint& output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
void UnlockCoin(const COutPoint& output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
void UnlockCoin(const COutPoint& output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
|
|||||||
Reference in new issue
Block a user