refactor: move CreatedTransactionResult to types.h
So it can be used by external modules without requiring wallet.h dependency.
This commit is contained in:
2 files changed
+14
-12
No files matched your search
+1
-11
@@ -10,6 +10,7 @@
|
|||||||
#include <util/result.h>
|
#include <util/result.h>
|
||||||
#include <wallet/coinselection.h>
|
#include <wallet/coinselection.h>
|
||||||
#include <wallet/transaction.h>
|
#include <wallet/transaction.h>
|
||||||
|
#include <wallet/types.h>
|
||||||
#include <wallet/wallet.h>
|
#include <wallet/wallet.h>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -186,17 +187,6 @@ util::Result<SelectionResult> SelectCoins(const CWallet& wallet, CoinsResult& av
|
|||||||
const CAmount& nTargetValue, const CCoinControl& coin_control,
|
const CAmount& nTargetValue, const CCoinControl& coin_control,
|
||||||
const CoinSelectionParams& coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
|
const CoinSelectionParams& coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
|
||||||
|
|
||||||
struct CreatedTransactionResult
|
|
||||||
{
|
|
||||||
CTransactionRef tx;
|
|
||||||
CAmount fee;
|
|
||||||
FeeCalculation fee_calc;
|
|
||||||
std::optional<unsigned int> change_pos;
|
|
||||||
|
|
||||||
CreatedTransactionResult(CTransactionRef _tx, CAmount _fee, std::optional<unsigned int> _change_pos, const FeeCalculation& _fee_calc)
|
|
||||||
: tx(_tx), fee(_fee), fee_calc(_fee_calc), change_pos(_change_pos) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a height-based locktime for new transactions (uses the height of the
|
* Set a height-based locktime for new transactions (uses the height of the
|
||||||
* current chain tip unless we are not synced with the current chain
|
* current chain tip unless we are not synced with the current chain
|
||||||
|
|||||||
+13
-1
@@ -14,7 +14,7 @@
|
|||||||
#ifndef BITCOIN_WALLET_TYPES_H
|
#ifndef BITCOIN_WALLET_TYPES_H
|
||||||
#define BITCOIN_WALLET_TYPES_H
|
#define BITCOIN_WALLET_TYPES_H
|
||||||
|
|
||||||
#include <type_traits>
|
#include <policy/fees/block_policy_estimator.h>
|
||||||
|
|
||||||
namespace wallet {
|
namespace wallet {
|
||||||
/**
|
/**
|
||||||
@@ -30,6 +30,18 @@ enum class AddressPurpose {
|
|||||||
SEND,
|
SEND,
|
||||||
REFUND, //!< Never set in current code may be present in older wallet databases
|
REFUND, //!< Never set in current code may be present in older wallet databases
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CreatedTransactionResult
|
||||||
|
{
|
||||||
|
CTransactionRef tx;
|
||||||
|
CAmount fee;
|
||||||
|
FeeCalculation fee_calc;
|
||||||
|
std::optional<unsigned int> change_pos;
|
||||||
|
|
||||||
|
CreatedTransactionResult(CTransactionRef _tx, CAmount _fee, std::optional<unsigned int> _change_pos, const FeeCalculation& _fee_calc)
|
||||||
|
: tx(_tx), fee(_fee), fee_calc(_fee_calc), change_pos(_change_pos) {}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace wallet
|
} // namespace wallet
|
||||||
|
|
||||||
#endif // BITCOIN_WALLET_TYPES_H
|
#endif // BITCOIN_WALLET_TYPES_H
|
||||||
Reference in new issue
Block a user