Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,772 Lines • ▼ Show 20 Lines | bool CWalletTx::AcceptToMemoryPool(const Amount nAbsurdFee, | ||||
bool ret = ::AcceptToMemoryPool( | bool ret = ::AcceptToMemoryPool( | ||||
GetConfig(), g_mempool, state, tx, true /* fLimitFree */, | GetConfig(), g_mempool, state, tx, true /* fLimitFree */, | ||||
nullptr /* pfMissingInputs */, false /* fOverrideMempoolLimit */, | nullptr /* pfMissingInputs */, false /* fOverrideMempoolLimit */, | ||||
nAbsurdFee); | nAbsurdFee); | ||||
fInMempool = ret; | fInMempool = ret; | ||||
return ret; | return ret; | ||||
} | } | ||||
static const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy"; | |||||
bool ParseOutputType(const std::string &type, OutputType &output_type) { | |||||
if (type == OUTPUT_TYPE_STRING_LEGACY) { | |||||
output_type = OutputType::LEGACY; | |||||
return true; | |||||
} | |||||
return false; | |||||
} | |||||
const std::string &FormatOutputType(OutputType type) { | |||||
switch (type) { | |||||
case OutputType::LEGACY: | |||||
return OUTPUT_TYPE_STRING_LEGACY; | |||||
default: | |||||
assert(false); | |||||
} | |||||
} | |||||
void CWallet::LearnRelatedScripts(const CPubKey &key, OutputType type) { | void CWallet::LearnRelatedScripts(const CPubKey &key, OutputType type) { | ||||
// Nothing to do... | // Nothing to do... | ||||
} | } | ||||
void CWallet::LearnAllRelatedScripts(const CPubKey &key) { | void CWallet::LearnAllRelatedScripts(const CPubKey &key) { | ||||
// Nothing to do... | // Nothing to do... | ||||
} | } | ||||
CTxDestination GetDestinationForKey(const CPubKey &key, OutputType type) { | |||||
switch (type) { | |||||
case OutputType::LEGACY: | |||||
return key.GetID(); | |||||
default: | |||||
assert(false); | |||||
} | |||||
} | |||||
std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey &key) { | |||||
return std::vector<CTxDestination>{key.GetID()}; | |||||
} | |||||
CTxDestination CWallet::AddAndGetDestinationForScript(const CScript &script, | |||||
OutputType type) { | |||||
// Note that scripts over 520 bytes are not yet supported. | |||||
switch (type) { | |||||
case OutputType::LEGACY: | |||||
return CScriptID(script); | |||||
default: | |||||
assert(false); | |||||
} | |||||
} | |||||
std::vector<OutputGroup> | std::vector<OutputGroup> | ||||
CWallet::GroupOutputs(const std::vector<COutput> &outputs, | CWallet::GroupOutputs(const std::vector<COutput> &outputs, | ||||
bool single_coin) const { | bool single_coin) const { | ||||
std::vector<OutputGroup> groups; | std::vector<OutputGroup> groups; | ||||
std::map<CTxDestination, OutputGroup> gmap; | std::map<CTxDestination, OutputGroup> gmap; | ||||
CTxDestination dst; | CTxDestination dst; | ||||
for (const auto &output : outputs) { | for (const auto &output : outputs) { | ||||
if (output.fSpendable) { | if (output.fSpendable) { | ||||
Show All 32 Lines |