Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 1,693 Lines • ▼ Show 20 Lines | int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, | ||||
const std::vector<CTxOut> &txouts, | const std::vector<CTxOut> &txouts, | ||||
bool use_max_sig) { | bool use_max_sig) { | ||||
CMutableTransaction txNew(tx); | CMutableTransaction txNew(tx); | ||||
if (!wallet->DummySignTx(txNew, txouts, use_max_sig)) { | if (!wallet->DummySignTx(txNew, txouts, use_max_sig)) { | ||||
// This should never happen, because IsAllFromMe(ISMINE_SPENDABLE) | // This should never happen, because IsAllFromMe(ISMINE_SPENDABLE) | ||||
// implies that we can sign for every input. | // implies that we can sign for every input. | ||||
return -1; | return -1; | ||||
} | } | ||||
return GetVirtualTransactionSize(CTransaction(txNew)); | return GetSerializeSize(txNew, PROTOCOL_VERSION); | ||||
} | } | ||||
int CalculateMaximumSignedInputSize(const CTxOut &txout, const CWallet *wallet, | int CalculateMaximumSignedInputSize(const CTxOut &txout, const CWallet *wallet, | ||||
bool use_max_sig) { | bool use_max_sig) { | ||||
CMutableTransaction txn; | CMutableTransaction txn; | ||||
txn.vin.push_back(CTxIn(COutPoint())); | txn.vin.push_back(CTxIn(COutPoint())); | ||||
if (!wallet->DummySignInput(txn.vin[0], txout, use_max_sig)) { | if (!wallet->DummySignInput(txn.vin[0], txout, use_max_sig)) { | ||||
// This should never happen, because IsAllFromMe(ISMINE_SPENDABLE) | // This should never happen, because IsAllFromMe(ISMINE_SPENDABLE) | ||||
// implies that we can sign for every input. | // implies that we can sign for every input. | ||||
return -1; | return -1; | ||||
} | } | ||||
return GetVirtualTransactionInputSize(txn.vin[0]); | return GetSerializeSize(txn.vin[0], PROTOCOL_VERSION); | ||||
} | } | ||||
void CWalletTx::GetAmounts(std::list<COutputEntry> &listReceived, | void CWalletTx::GetAmounts(std::list<COutputEntry> &listReceived, | ||||
std::list<COutputEntry> &listSent, Amount &nFee, | std::list<COutputEntry> &listSent, Amount &nFee, | ||||
std::string &strSentAccount, | std::string &strSentAccount, | ||||
const isminefilter &filter) const { | const isminefilter &filter) const { | ||||
nFee = Amount::zero(); | nFee = Amount::zero(); | ||||
listReceived.clear(); | listReceived.clear(); | ||||
▲ Show 20 Lines • Show All 3,183 Lines • Show Last 20 Lines |