Merge #6274: backport: bitcoin#23723, 23547, 24153, 23591

073d6d6b2a Merge bitcoin/bitcoin#23723: test: Replace hashlib.new with named constructor (MarcoFalke)
674dcf9a55 Merge bitcoin/bitcoin#23547: Bugfix: RPC/mining: Fail properly in estimatesmartfee if smart fee data is unavailable (MarcoFalke)
546e548755 Merge bitcoin/bitcoin#24153: test: remove unused sanitizer suppressions (fanquake)
78b06a4dd2 Merge bitcoin/bitcoin#23591: refactor: Use underlying type of isminetype for isminefilter (W. J. van der Laan)

Pull request description:

  backporting

ACKs for top commit:
  UdjinM6:
    utACK 073d6d6b2a
  knst:
    utACK 073d6d6b2a

Tree-SHA512: 5c5af5b795ec86f2b98cf9884e1275b8d3a5e7942f8b6632d74ecb799b1b7fe34071c052ac9af15abac14bad1b886ead5d0478f5e03fe0b461b7b40a7defef9e
This commit is contained in:
pasta 2024-09-24 08:52:04 -05:00
commit 8f8cd61fd6
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
5 changed files with 12 additions and 15 deletions

View File

@ -14,13 +14,14 @@
#include <util/message.h>
#include <util/ui_change_type.h>
#include <cstdint>
#include <functional>
#include <map>
#include <memory>
#include <psbt.h>
#include <stdint.h>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
@ -37,7 +38,7 @@ struct CRecipient;
struct PartiallySignedTransaction;
struct WalletContext;
struct bilingual_str;
typedef uint8_t isminefilter;
using isminefilter = std::underlying_type<isminetype>::type;
namespace interfaces {

View File

@ -1169,10 +1169,10 @@ static RPCHelpMan estimatesmartfee()
UniValue errors(UniValue::VARR);
FeeCalculation feeCalc;
CFeeRate feeRate{fee_estimator.estimateSmartFee(conf_target, &feeCalc, conservative)};
if (feeRate != CFeeRate(0)) {
CFeeRate min_mempool_feerate{mempool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000)};
CFeeRate min_relay_feerate{::minRelayTxFee};
feeRate = std::max({feeRate, min_mempool_feerate, min_relay_feerate});
if (feeRate != CFeeRate(0)) {
result.pushKV("feerate", ValueFromAmount(feeRate.GetFeePerK()));
} else {
errors.push_back("Insufficient data or no feerate found");

View File

@ -8,8 +8,9 @@
#include <script/standard.h>
#include <stdint.h>
#include <bitset>
#include <cstdint>
#include <type_traits>
class CWallet;
class CScript;
@ -35,8 +36,7 @@ class CScript;
* ISMINE_USED: the scriptPubKey corresponds to a used address owned by the wallet user.
*
*/
enum isminetype : unsigned int
{
enum isminetype : unsigned int {
ISMINE_NO = 0,
ISMINE_WATCH_ONLY = 1 << 0,
ISMINE_SPENDABLE = 1 << 1,
@ -46,7 +46,7 @@ enum isminetype : unsigned int
ISMINE_ENUM_ELEMENTS,
};
/** used for bitflags of isminetype */
typedef uint8_t isminefilter;
using isminefilter = std::underlying_type<isminetype>::type;
/**
* Cachable amount subdivided into watchonly and spendable parts.

View File

@ -62,9 +62,9 @@ MSG_TYPE_MASK = 0xffffffff >> 2
FILTER_TYPE_BASIC = 0
# Serialization/deserialization tools
def sha256(s):
return hashlib.new('sha256', s).digest()
return hashlib.sha256(s).digest()
def hash256(s):

View File

@ -82,12 +82,8 @@ implicit-signed-integer-truncation:addrman.h
implicit-signed-integer-truncation:chain.h
implicit-signed-integer-truncation:crypto/
implicit-signed-integer-truncation:leveldb/
implicit-signed-integer-truncation:miner.cpp
implicit-signed-integer-truncation:net.cpp
implicit-signed-integer-truncation:streams.h
implicit-signed-integer-truncation:test/arith_uint256_tests.cpp
implicit-signed-integer-truncation:test/skiplist_tests.cpp
implicit-signed-integer-truncation:torcontrol.cpp
implicit-unsigned-integer-truncation:*/include/c++/
implicit-unsigned-integer-truncation:crypto/
implicit-unsigned-integer-truncation:leveldb/