Merge #9681: Refactor Bumpfee, move core functionality to CWallet
5f59d3eImprove CFeeBumper interface, add comments, make use of std::move (Jonas Schnelli)0df22edCancel feebump is vErrors is not empty (Jonas Schnelli)44cabe6Use static calls for GetRequiredFee and GetMinimumFee, remove make_pair from emplace_back (Jonas Schnelli)bb78c15Restore CalculateMaximumSignedTxSize function signature (Jonas Schnelli)51ea44fUse "return false" instead assert() in CWallet::SignTransaction (Jonas Schnelli)bcc72ccDirectly abort execution in FeeBumper::commit if wallet or tx is not available (Jonas Schnelli)2718db0Restore invalid fee check (must be > 0) (Jonas Schnelli)0337a39Refactor Bumpfee core functionality (Jonas Schnelli)d1a95e8Bumpfee move request parameter interaction to the top (Jonas Schnelli) Tree-SHA512: 0e6d1f3322ed671fa2291e59ac9556ce4646bc78267edc6eedc46b0014b7b08aa83c30315358b911d82898847d4845634a18b67e253a7b699dcc852eb2652c07
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "validation.h"
|
||||
#include "net.h"
|
||||
#include "policy/policy.h"
|
||||
#include "policy/rbf.h"
|
||||
#include "primitives/block.h"
|
||||
#include "primitives/transaction.h"
|
||||
#include "script/script.h"
|
||||
@@ -2255,6 +2256,28 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
|
||||
return res;
|
||||
}
|
||||
|
||||
bool CWallet::SignTransaction(CMutableTransaction &tx)
|
||||
{
|
||||
// sign the new tx
|
||||
CTransaction txNewConst(tx);
|
||||
int nIn = 0;
|
||||
for (auto& input : tx.vin) {
|
||||
std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(input.prevout.hash);
|
||||
if(mi == mapWallet.end() || input.prevout.n >= mi->second.tx->vout.size()) {
|
||||
return false;
|
||||
}
|
||||
const CScript& scriptPubKey = mi->second.tx->vout[input.prevout.n].scriptPubKey;
|
||||
const CAmount& amount = mi->second.tx->vout[input.prevout.n].nValue;
|
||||
SignatureData sigdata;
|
||||
if (!ProduceSignature(TransactionSignatureCreator(this, &txNewConst, nIn, amount, SIGHASH_ALL), scriptPubKey, sigdata)) {
|
||||
return false;
|
||||
}
|
||||
UpdateTransaction(tx, nIn, sigdata);
|
||||
nIn++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, bool overrideEstimatedFeeRate, const CFeeRate& specificFeeRate, int& nChangePosInOut, std::string& strFailReason, bool includeWatching, bool lockUnspents, const std::set<int>& setSubtractFeeFromOutputs, bool keepReserveKey, const CTxDestination& destChange)
|
||||
{
|
||||
std::vector<CRecipient> vecSend;
|
||||
|
||||
Reference in New Issue
Block a user