@@ -94,23 +94,23 @@ bool CWalletDB::WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey)
9494
9595bool CWalletDB::WriteCScript (const uint160& hash, const CScript& redeemScript)
9696{
97- return WriteIC (std::make_pair (std::string (" cscript" ), hash), *( const CScriptBase*)(& redeemScript) , false );
97+ return WriteIC (std::make_pair (std::string (" cscript" ), hash), redeemScript, false );
9898}
9999
100100bool CWalletDB::WriteWatchOnly (const CScript &dest, const CKeyMetadata& keyMeta)
101101{
102- if (!WriteIC (std::make_pair (std::string (" watchmeta" ), *( const CScriptBase*)(& dest) ), keyMeta)) {
102+ if (!WriteIC (std::make_pair (std::string (" watchmeta" ), dest), keyMeta)) {
103103 return false ;
104104 }
105- return WriteIC (std::make_pair (std::string (" watchs" ), *( const CScriptBase*)(& dest) ), ' 1' );
105+ return WriteIC (std::make_pair (std::string (" watchs" ), dest), ' 1' );
106106}
107107
108108bool CWalletDB::EraseWatchOnly (const CScript &dest)
109109{
110- if (!EraseIC (std::make_pair (std::string (" watchmeta" ), *( const CScriptBase*)(& dest) ))) {
110+ if (!EraseIC (std::make_pair (std::string (" watchmeta" ), dest))) {
111111 return false ;
112112 }
113- return EraseIC (std::make_pair (std::string (" watchs" ), *( const CScriptBase*)(& dest) ));
113+ return EraseIC (std::make_pair (std::string (" watchs" ), dest));
114114}
115115
116116bool CWalletDB::WriteBestBlock (const CBlockLocator& locator)
@@ -323,7 +323,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
323323 {
324324 wss.nWatchKeys ++;
325325 CScript script;
326- ssKey >> *(CScriptBase*)(& script) ;
326+ ssKey >> script;
327327 char fYes ;
328328 ssValue >> fYes ;
329329 if (fYes == ' 1' )
@@ -440,7 +440,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
440440 else if (strType == " watchmeta" )
441441 {
442442 CScript script;
443- ssKey >> *(CScriptBase*)(& script) ;
443+ ssKey >> script;
444444 keyID = CScriptID (script);
445445 }
446446
@@ -474,7 +474,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
474474 uint160 hash;
475475 ssKey >> hash;
476476 CScript script;
477- ssValue >> *(CScriptBase*)(& script) ;
477+ ssValue >> script;
478478 if (!pwallet->LoadCScript (script))
479479 {
480480 strErr = " Error reading wallet database: LoadCScript failed" ;
0 commit comments