Skip to content

Commit defeec2

Browse files
committed
Merge branch 'master' into elements-22.1.2-rc1-prep
2 parents 10d845d + 93cc036 commit defeec2

File tree

198 files changed

+24809
-6646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+24809
-6646
lines changed

ci/test/04_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ DOCKER_EXEC df -h
8686

8787
if [ "$RUN_FUZZ_TESTS" = "true" ] || [ "$RUN_UNIT_TESTS" = "true" ] || [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
8888
if [ ! -d ${DIR_QA_ASSETS} ]; then
89-
DOCKER_EXEC git clone --depth=1 https://github.com/bitcoin-core/qa-assets ${DIR_QA_ASSETS}
89+
DOCKER_EXEC git clone --depth=1 https://github.com/ElementsProject/qa-assets ${DIR_QA_ASSETS}
9090
fi
9191

9292
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ case $host in
673673
AC_MSG_ERROR("windres not found")
674674
fi
675675

676+
CPPFLAGS="$CPPFLAGS -DSECP256K1_STATIC"
676677
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN"
677678

678679
dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.

doc/elements-confidential-transactions.md

Lines changed: 492 additions & 0 deletions
Large diffs are not rendered by default.

src/chain.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ class CBlockIndex
217217
m_signblock_witness = std::nullopt;
218218
}
219219

220-
bool trimmed() const {
220+
inline bool trimmed() const {
221221
return m_trimmed;
222222
}
223223

224-
void assert_untrimmed() const {
224+
inline void assert_untrimmed() const {
225225
assert(!m_trimmed);
226226
}
227227

@@ -230,7 +230,7 @@ class CBlockIndex
230230
return proof.value();
231231
}
232232

233-
const bool dynafed_block() const {
233+
bool is_dynafed_block() const {
234234
if (m_trimmed) {
235235
return m_trimmed_dynafed_block;
236236
}
@@ -417,12 +417,12 @@ class CDiskBlockIndex : public CBlockIndex
417417
nVersion = ~CBlockHeader::DYNAFED_HF_MASK & nVersion;
418418
return is_dyna;
419419
} else {
420-
return !dynafed_params().IsNull();
420+
return is_dynafed_block();
421421
}
422422
}
423423
bool RemoveDynaFedMaskOnSerialize(bool for_read) const {
424424
assert(!for_read);
425-
return !dynafed_params().IsNull();
425+
return is_dynafed_block();
426426
}
427427

428428
SERIALIZE_METHODS(CDiskBlockIndex, obj)
@@ -445,12 +445,12 @@ class CDiskBlockIndex : public CBlockIndex
445445
READWRITE(obj.nVersion);
446446
} else {
447447
int32_t nVersion = obj.nVersion;
448-
if (!obj.dynafed_params().IsNull()) {
448+
if (obj.is_dynafed_block()) {
449449
nVersion |= CBlockHeader::DYNAFED_HF_MASK;
450450
}
451451
READWRITE(nVersion);
452452
}
453-
bool is_dyna = obj.RemoveDynaFedMaskOnSerialize(ser_action.ForRead());;
453+
bool is_dyna = obj.RemoveDynaFedMaskOnSerialize(ser_action.ForRead());
454454

455455
READWRITE(obj.hashPrev);
456456
READWRITE(obj.hashMerkleRoot);

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
986986
epoch_length = 20160;
987987
}
988988

989-
if (args.IsArgSet("-trim_headers")) {
989+
if (args.GetBoolArg("-trim_headers", false)) {
990990
LogPrintf("Configured for header-trimming mode. This will reduce memory usage substantially, but we will be unable to serve as a full P2P peer, and certain header fields may be missing from JSON RPC output.\n");
991991
fTrimHeaders = true;
992992
// This calculation is driven by GetValidFedpegScripts in pegins.cpp, which walks the chain

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,7 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, const Peer& peer,
20232023
if ((nodestate->pindexBestKnownBlock == nullptr) ||
20242024
(nodestate->pindexBestKnownBlock->nHeight < m_chainman.ActiveHeight())) {
20252025
// Our notion of what blocks a peer has available is based on its pindexBestKnownBlock,
2026-
// which is based on headers recieved from it. If we don't have one, or it's too old,
2026+
// which is based on headers received from it. If we don't have one, or it's too old,
20272027
// then we can never get blocks from this peer until we accept headers from it first.
20282028
LogPrint(BCLog::NET, "NOT discarding headers from peer=%d, to update its block availability. (current best header %d, active chain height %d)\n", pfrom.GetId(), pindexBestHeader->nHeight, m_chainman.ActiveHeight());
20292029
} else {

src/qt/bitcoinunits.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <QStringList>
88

99
#include <cassert>
10+
#include <util/system.h>
1011

1112
static constexpr auto MAX_DIGITS_BTC = 16;
1213

@@ -42,6 +43,19 @@ bool BitcoinUnits::valid(int unit)
4243

4344
QString BitcoinUnits::longName(int unit)
4445
{
46+
const std::string default_asset_name = gArgs.GetArg("-defaultpeggedassetname", "");
47+
if (default_asset_name != "") {
48+
std::string rv;
49+
switch(unit)
50+
{
51+
case BTC: rv=default_asset_name;break;
52+
case mBTC: rv=std::string("m-")+default_asset_name;break;
53+
case uBTC: rv=std::string("μ-")+default_asset_name;break;
54+
case SAT: rv=std::string("sat-")+default_asset_name;break;
55+
default: rv="???";break;
56+
}
57+
return QString::fromUtf8(rv.c_str());
58+
}
4559
switch(unit)
4660
{
4761
case BTC: return QString("L-BTC");
@@ -54,6 +68,9 @@ QString BitcoinUnits::longName(int unit)
5468

5569
QString BitcoinUnits::shortName(int unit)
5670
{
71+
if (gArgs.GetArg("-defaultpeggedassetname", "") != "") {
72+
return longName(unit);
73+
}
5774
switch(unit)
5875
{
5976
case uBTC: return QString::fromUtf8("L-bits");

src/rpc/blockchain.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,17 @@ UniValue paramEntryToJSON(const DynaFedParamEntry& entry)
154154
}
155155

156156
// fields all params have
157-
result.pushKV("root", HexStr(entry.CalculateRoot()));
157+
result.pushKV("root", entry.CalculateRoot().GetHex());
158158
result.pushKV("signblockscript", HexStr(entry.m_signblockscript));
159159
result.pushKV("max_block_witness", (uint64_t)entry.m_signblock_witness_limit);
160160

161161
// add the extra root which is stored for compact and calculated for full
162162
if (entry.m_serialize_type == 1) {
163163
// compact
164-
result.pushKV("extra_root", HexStr(entry.m_elided_root));
164+
result.pushKV("extra_root", entry.m_elided_root.GetHex());
165165
} else if (entry.m_serialize_type == 2) {
166166
// full
167-
result.pushKV("extra_root", HexStr(entry.CalculateExtraRoot()));
167+
result.pushKV("extra_root", entry.CalculateExtraRoot().GetHex());
168168
}
169169

170170
// some extra fields only present on full params
@@ -248,7 +248,7 @@ UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex
248248
result.pushKV("difficulty", GetDifficulty(blockindex));
249249
result.pushKV("chainwork", blockindex->nChainWork.GetHex());
250250
} else {
251-
if (!blockindex->dynafed_block()) {
251+
if (!blockindex->is_dynafed_block()) {
252252
if (blockindex->trimmed()) {
253253
result.pushKV("signblock_witness_asm", "<trimmed>");
254254
result.pushKV("signblock_witness_hex", "<trimmed>");

0 commit comments

Comments
 (0)