aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-11-30 16:49:04 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2018-01-09 15:35:27 -0800
commitf37c64e477d679853a4076f2f7888568bb034e90 (patch)
treec89e9c12f55bf306452d8cd20c45a7a81f9fed6e /src/wallet
parent57273f2b302949d4ca3511f703627b5d717be40c (diff)
downloadbitcoin-f37c64e477d679853a4076f2f7888568bb034e90.tar.xz
Implicitly know about P2WPKH redeemscripts
Make CKeyStore automatically known about the redeemscripts necessary for P2SH-P2WPKH (and due to the extra checks in IsMine, also P2WPKH) spending.
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/crypter.cpp1
-rw-r--r--src/wallet/rpcwallet.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/crypter.cpp b/src/wallet/crypter.cpp
index 4cd7db048b..72ed5af42d 100644
--- a/src/wallet/crypter.cpp
+++ b/src/wallet/crypter.cpp
@@ -245,6 +245,7 @@ bool CCryptoKeyStore::AddCryptedKey(const CPubKey &vchPubKey, const std::vector<
}
mapCryptedKeys[vchPubKey.GetID()] = make_pair(vchPubKey, vchCryptedSecret);
+ ImplicitlyLearnRelatedKeyScripts(vchPubKey);
return true;
}
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index b366992dec..e4b2b020b7 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -1307,7 +1307,7 @@ UniValue addwitnessaddress(const JSONRPCRequest& request)
throw JSONRPCError(RPC_WALLET_ERROR, "Cannot convert between witness address types");
}
} else {
- pwallet->AddCScript(witprogram);
+ pwallet->AddCScript(witprogram); // Implicit for single-key now, but necessary for multisig and for compatibility with older software
pwallet->SetAddressBook(w.result, "", "receive");
}