Support absence of wallet (pwalletMain==NULL) in several locations,

notably RPC.
This commit is contained in:
Jeff Garzik
2013-08-25 00:00:02 -04:00
parent 19c415b1cf
commit b0730874d9
6 changed files with 123 additions and 92 deletions

View File

@@ -171,6 +171,7 @@ Value listunspent(const Array& params, bool fHelp)
Array results;
vector<COutput> vecOutputs;
assert(pwalletMain != NULL);
pwalletMain->AvailableCoins(vecOutputs, false);
BOOST_FOREACH(const COutput& out, vecOutputs)
{
@@ -458,7 +459,7 @@ Value signrawtransaction(const Array& params, bool fHelp)
}
}
const CKeyStore& keystore = (fGivenKeys ? tempKeystore : *pwalletMain);
const CKeyStore& keystore = ((fGivenKeys || !pwalletMain) ? tempKeystore : *pwalletMain);
int nHashType = SIGHASH_ALL;
if (params.size() > 3 && params[3].type() != null_type)