Skip to content

Commit 44cabe6

Browse files
committed
Use static calls for GetRequiredFee and GetMinimumFee, remove make_pair from emplace_back
1 parent bb78c15 commit 44cabe6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/wallet/feebumper.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *pWal
3030
for (auto& input : tx.vin) {
3131
const auto mi = pWallet->mapWallet.find(input.prevout.hash);
3232
assert(mi != pWallet->mapWallet.end() && input.prevout.n < mi->second.tx->vout.size());
33-
vCoins.emplace_back(std::make_pair(&(mi->second), input.prevout.n));
33+
vCoins.emplace_back(&(mi->second), input.prevout.n);
3434
}
3535
if (!pWallet->DummySignTx(txNew, vCoins)) {
3636
// This should never happen, because IsAllFromMe(ISMINE_SPENDABLE)
@@ -147,7 +147,7 @@ CFeeBumper::CFeeBumper(const CWallet *pWallet, const uint256 txidIn, int newConf
147147
currentResult = BumpFeeResult::INVALID_PARAMETER;
148148
return;
149149
}
150-
CAmount requiredFee = pWallet->GetRequiredFee(maxNewTxSize);
150+
CAmount requiredFee = CWallet::GetRequiredFee(maxNewTxSize);
151151
if (totalFee < requiredFee) {
152152
vErrors.push_back(strprintf("Insufficient totalFee (cannot be less than required fee %s)",
153153
FormatMoney(requiredFee)));
@@ -159,11 +159,11 @@ CFeeBumper::CFeeBumper(const CWallet *pWallet, const uint256 txidIn, int newConf
159159
} else {
160160
// if user specified a confirm target then don't consider any global payTxFee
161161
if (specifiedConfirmTarget) {
162-
nNewFee = pWallet->GetMinimumFee(maxNewTxSize, newConfirmTarget, mempool, CAmount(0));
162+
nNewFee = CWallet::GetMinimumFee(maxNewTxSize, newConfirmTarget, mempool, CAmount(0));
163163
}
164164
// otherwise use the regular wallet logic to select payTxFee or default confirm target
165165
else {
166-
nNewFee = pWallet->GetMinimumFee(maxNewTxSize, newConfirmTarget, mempool);
166+
nNewFee = CWallet::GetMinimumFee(maxNewTxSize, newConfirmTarget, mempool);
167167
}
168168

169169
nNewFeeRate = CFeeRate(nNewFee, maxNewTxSize);

0 commit comments

Comments
 (0)