32 #ifndef LEDGER_CORE_BITCOINLIKESTRATEGYUTXOPICKER_H 33 #define LEDGER_CORE_BITCOINLIKESTRATEGYUTXOPICKER_H 35 #include "BitcoinLikeUtxoPicker.h" 45 UTXODescriptorList filterWithDeepFirst(
const std::shared_ptr<Buddy> &buddy,
46 const std::vector<std::shared_ptr<api::BitcoinLikeOutput>>& utxo,
47 const BigInt& aggregatedAmount);
48 bool hasEnough(
const std::shared_ptr<Buddy>& buddy,
const BigInt& aggregatedAmount,
int inputCount,
bool computeOutputAmount =
false);
49 inline Future<BigInt> computeAggregatedAmount(
const std::shared_ptr<Buddy>& buddy);
53 std::shared_ptr<api::BitcoinLikeOutput> output;
54 int64_t effectiveValue;
55 int64_t effectiveFees;
58 BitcoinLikeUtxoPicker::UTXODescriptorList filterWithOptimizeSize(
const std::shared_ptr<BitcoinLikeUtxoPicker::Buddy> &buddy,
59 const std::vector<std::shared_ptr<api::BitcoinLikeOutput>> &utxos,
60 const BigInt &aggregatedAmount);
62 BitcoinLikeUtxoPicker::UTXODescriptorList filterWithMergeOutputs(
const std::shared_ptr<BitcoinLikeUtxoPicker::Buddy> &buddy,
63 const std::vector<std::shared_ptr<api::BitcoinLikeOutput>> &utxos,
64 const BigInt &aggregatedAmount);
67 static const int64_t DEFAULT_FALLBACK_FEE = 20;
68 static const int64_t DEFAULT_DISCARD_FEE = 10;
69 static const int64_t COIN = 100000000;
70 static const int64_t MAX_MONEY = 21000000 * COIN;
71 static const uint32_t TOTAL_TRIES = 100000;
72 static const int64_t CENT = 1000000;
73 static const int64_t MIN_CHANGE = 100000;
75 BitcoinLikeUtxoPicker::UTXODescriptorList filterWithKnapsackSolver(
const std::shared_ptr<BitcoinLikeUtxoPicker::Buddy> &buddy,
76 const std::vector<std::shared_ptr<api::BitcoinLikeOutput>> &utxos,
77 const BigInt &aggregatedAmount);
84 #endif //LEDGER_CORE_BITCOINLIKESTRATEGYUTXOPICKER_H Definition: BitcoinLikeUtxoPicker.h:52
Definition: Deffered.hpp:49
Definition: Currency.hpp:23
Definition: BitcoinLikeStrategyUtxoPicker.h:52
Definition: Account.cpp:8
Definition: BitcoinLikeStrategyUtxoPicker.h:39