Guards for nSPV in decode/send raw transaction
This commit is contained in:
@@ -35,7 +35,6 @@ bool CKeyStore::GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
|
||||
}
|
||||
|
||||
bool CKeyStore::AddKey(const CKey &key) {
|
||||
fprintf(stderr,"addkey\n");
|
||||
return AddKeyPubKey(key, key.GetPubKey());
|
||||
}
|
||||
|
||||
@@ -72,12 +71,6 @@ bool CBasicKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey)
|
||||
{
|
||||
LOCK(cs_KeyStore);
|
||||
mapKeys[pubkey.GetID()] = key;
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<33; i++)
|
||||
fprintf(stderr,"%02x",((uint8_t *)&pubkey)[i]);
|
||||
fprintf(stderr," addpubkey pub\n");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -368,7 +368,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
|
||||
entry.push_back(Pair("vin", vin));
|
||||
UniValue vout(UniValue::VARR);
|
||||
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
|
||||
CBlockIndex *tipindex,*pindex = it->second;
|
||||
CBlockIndex *tipindex;//,*pindex = it->second;
|
||||
uint64_t interest;
|
||||
for (unsigned int i = 0; i < tx.vout.size(); i++) {
|
||||
const CTxOut& txout = tx.vout[i];
|
||||
@@ -1317,7 +1317,8 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
|
||||
bool fOverrideFees = false;
|
||||
if (params.size() > 1)
|
||||
fOverrideFees = params[1].get_bool();
|
||||
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
{
|
||||
CCoinsViewCache &view = *pcoinsTip;
|
||||
const CCoins* existingCoins = view.AccessCoins(hashTx);
|
||||
bool fHaveMempool = mempool.exists(hashTx);
|
||||
@@ -1339,6 +1340,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp)
|
||||
} else if (fHaveChain) {
|
||||
throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain");
|
||||
}
|
||||
}
|
||||
RelayTransaction(tx);
|
||||
|
||||
return hashTx.GetHex();
|
||||
|
||||
@@ -44,10 +44,7 @@ bool TransactionSignatureCreator::CreateSig(std::vector<unsigned char>& vchSig,
|
||||
if (pprivKey)
|
||||
key = *pprivKey;
|
||||
else if (!keystore || !keystore->GetKey(address, key))
|
||||
{
|
||||
fprintf(stderr,"couldnt find key\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
uint256 hash;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user