diff options
| author | Pieter Wuille <[email protected]> | 2019-04-06 08:23:19 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2019-04-06 09:14:56 -0700 |
| commit | b5d39877242504160a7f2c24c60c07a845d7a064 (patch) | |
| tree | ed527112e0c21af94d05653b4105286b92f049fc /src | |
| parent | Import all origin info in importmulti; even for non-importing pubkeys (diff) | |
| download | discoin-b5d39877242504160a7f2c24c60c07a845d7a064.tar.xz discoin-b5d39877242504160a7f2c24c60c07a845d7a064.zip | |
Take non-importing keys into account for spendability warning in descriptor import
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/rpcdump.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 4cbb39c81..c339e111b 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -1197,6 +1197,9 @@ static UniValue ProcessImportDescriptor(ImportData& import_data, std::map<CKeyID bool spendable = std::all_of(pubkey_map.begin(), pubkey_map.end(), [&](const std::pair<CKeyID, CPubKey>& used_key) { return privkey_map.count(used_key.first) > 0; + }) && std::all_of(import_data.key_origins.begin(), import_data.key_origins.end(), + [&](const std::pair<CKeyID, std::pair<CPubKey, KeyOriginInfo>>& entry) { + return privkey_map.count(entry.first) > 0; }); if (!watch_only && !spendable) { warnings.push_back("Some private keys are missing, outputs will be considered watchonly. If this is intentional, specify the watchonly flag."); |