Browse Source

Use static calls for GetRequiredFee and GetMinimumFee, remove make_pair from emplace_back

0.15
Jonas Schnelli 8 years ago
parent
commit
44cabe6380
No known key found for this signature in database
GPG Key ID: 1EB776BB03C7922D
  1. 8
      src/wallet/feebumper.cpp

8
src/wallet/feebumper.cpp

@ -30,7 +30,7 @@ int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *pWal @@ -30,7 +30,7 @@ int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *pWal
for (auto& input : tx.vin) {
const auto mi = pWallet->mapWallet.find(input.prevout.hash);
assert(mi != pWallet->mapWallet.end() && input.prevout.n < mi->second.tx->vout.size());
vCoins.emplace_back(std::make_pair(&(mi->second), input.prevout.n));
vCoins.emplace_back(&(mi->second), input.prevout.n);
}
if (!pWallet->DummySignTx(txNew, vCoins)) {
// This should never happen, because IsAllFromMe(ISMINE_SPENDABLE)
@ -147,7 +147,7 @@ CFeeBumper::CFeeBumper(const CWallet *pWallet, const uint256 txidIn, int newConf @@ -147,7 +147,7 @@ CFeeBumper::CFeeBumper(const CWallet *pWallet, const uint256 txidIn, int newConf
currentResult = BumpFeeResult::INVALID_PARAMETER;
return;
}
CAmount requiredFee = pWallet->GetRequiredFee(maxNewTxSize);
CAmount requiredFee = CWallet::GetRequiredFee(maxNewTxSize);
if (totalFee < requiredFee) {
vErrors.push_back(strprintf("Insufficient totalFee (cannot be less than required fee %s)",
FormatMoney(requiredFee)));
@ -159,11 +159,11 @@ CFeeBumper::CFeeBumper(const CWallet *pWallet, const uint256 txidIn, int newConf @@ -159,11 +159,11 @@ CFeeBumper::CFeeBumper(const CWallet *pWallet, const uint256 txidIn, int newConf
} else {
// if user specified a confirm target then don't consider any global payTxFee
if (specifiedConfirmTarget) {
nNewFee = pWallet->GetMinimumFee(maxNewTxSize, newConfirmTarget, mempool, CAmount(0));
nNewFee = CWallet::GetMinimumFee(maxNewTxSize, newConfirmTarget, mempool, CAmount(0));
}
// otherwise use the regular wallet logic to select payTxFee or default confirm target
else {
nNewFee = pWallet->GetMinimumFee(maxNewTxSize, newConfirmTarget, mempool);
nNewFee = CWallet::GetMinimumFee(maxNewTxSize, newConfirmTarget, mempool);
}
nNewFeeRate = CFeeRate(nNewFee, maxNewTxSize);

Loading…
Cancel
Save