Skip to content

Commit 580230f

Browse files
committed
Merge #1147: [backport] Backport fixes from master to elements-22.x for rc4
85c25b1 Bump version to -rc4 (Pablo Greco) bb684f2 Update manpages (Pablo Greco) 38e9490 Elements-qt: Fix arrows to increase/decrease Amount (Andrea Bonel) 5954b10 Fixing issuance cases and half blinded cases in PSET (Allen Piscitello) 707cf20 Fix tapscript comment (roconnor-blockstream) 7fb99ff Fix Icon position in dmg (Pablo Greco) Pull request description: Backport #1140 #1141 #1145 and #1146 from master. Fix manpages Bump to -rc4 ACKs for top commit: delta1: utACK 85c25b1 Tree-SHA512: 78a30bec870530275d103b6cab630ebf96b2df39fd03fc426bb16b6743ce9311f7e7128e43bf7a6452d261377e6ac017d61b77cd9ad4e4c20040629ae20e13b4
2 parents 3e44c1f + 85c25b1 commit 580230f

13 files changed

+38
-21
lines changed

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AC_PREREQ([2.69])
22
define(_CLIENT_VERSION_MAJOR, 22)
33
define(_CLIENT_VERSION_MINOR, 0)
44
define(_CLIENT_VERSION_BUILD, 0)
5-
define(_CLIENT_VERSION_RC, 3)
5+
define(_CLIENT_VERSION_RC, 4)
66
define(_CLIENT_VERSION_IS_RELEASE, true)
77
define(_COPYRIGHT_YEAR, 2022)
88
define(_COPYRIGHT_HOLDERS,[The %s developers])

contrib/macdeploy/macdeployqtplus

+1-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ ds['.']['icvp'] = icvp
536536
ds['.']['vSrn'] = ('long', 1)
537537

538538
ds['Applications']['Iloc'] = (370, 156)
539-
ds['Bitcoin-Qt.app']['Iloc'] = (128, 156)
539+
ds['Elements-Qt.app']['Iloc'] = (128, 156)
540540

541541
ds.flush()
542542
ds.close()

doc/man/elements-cli.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ elements-cli \- manual page for elements-cli v22.0.0
1515
.B elements-cli
1616
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
1717
.SH DESCRIPTION
18-
Elements Core RPC client version elements\-22.0.0
18+
Elements Core RPC client version v22.0.0
1919
.SH OPTIONS
2020
.HP
2121
\-?

doc/man/elements-qt.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ elements-qt \- manual page for elements-qt v22.0.0
66
.B elements-qt
77
[\fI\,command-line options\/\fR]
88
.SH DESCRIPTION
9-
Elements Core version elements\-22.0.0
9+
Elements Core version v22.0.0
1010
.SH OPTIONS
1111
.HP
1212
\-?

doc/man/elements-tx.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ elements-tx \- manual page for elements-tx v22.0.0
99
.B elements-tx
1010
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded Elements transaction\/\fR
1111
.SH DESCRIPTION
12-
Elements Core elements\-tx utility version elements\-22.0.0
12+
Elements Core elements\-tx utility version v22.0.0
1313
.SH OPTIONS
1414
.HP
1515
\-?

doc/man/elements-util.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ elements-util \- manual page for elements-util v22.0.0
66
.B elements-util
77
[\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR
88
.SH DESCRIPTION
9-
Elements Core elements\-util utility version elements\-22.0.0
9+
Elements Core elements\-util utility version v22.0.0
1010
.SH OPTIONS
1111
.HP
1212
\-?

doc/man/elements-wallet.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.SH NAME
44
elements-wallet \- manual page for elements-wallet v22.0.0
55
.SH DESCRIPTION
6-
Elements Core elements\-wallet version elements\-22.0.0
6+
Elements Core elements\-wallet version v22.0.0
77
.PP
88
elements\-wallet is an offline tool for creating and interacting with Elements Core wallet files.
99
By default elements\-wallet will act on wallets in the default mainnet wallet directory in the datadir.

doc/man/elementsd.1

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ elementsd \- manual page for elementsd v22.0.0
66
.B elementsd
77
[\fI\,options\/\fR] \fI\,Start Elements Core\/\fR
88
.SH DESCRIPTION
9-
Elements Core version elements\-22.0.0
10-
Copyright \(co 2009\-2021 The Elements Project developers
11-
Copyright \(co 2009\-2021 The Bitcoin Core developers
9+
Elements Core version v22.0.0
10+
Copyright \(co 2009\-2022 The Elements Project developers
11+
Copyright \(co 2009\-2022 The Bitcoin Core developers
1212
.PP
1313
Please contribute if you find Elements Core useful. Visit
1414
<https://elementsproject.org/> for further information about the software.

src/blindpsbt.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ BlindingStatus BlindPSBT(PartiallySignedTransaction& psbt, std::map<uint32_t, st
476476
}
477477
}
478478
}
479+
else {
480+
input_asset_blinders.emplace_back();
481+
}
479482
}
480483
}
481484
}

src/psbt.cpp

+19-9
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,26 @@ CMutableTransaction PartiallySignedTransaction::GetUnsignedTx(bool force_unblind
123123
txin.nSequence = input.sequence.value_or(max_sequence);
124124
txin.assetIssuance.assetBlindingNonce = input.m_issuance_blinding_nonce;
125125
txin.assetIssuance.assetEntropy = input.m_issuance_asset_entropy;
126-
if (input.m_issuance_value != std::nullopt && input.m_issuance_inflation_keys_amount != std::nullopt && force_unblinded) {
126+
// If there is a commitment we should set the value to the commitment unless we are forcing unblinded.
127+
// If we are forcing unblinded but there is no value, we just use the commitment.
128+
if (input.m_issuance_value != std::nullopt && (input.m_issuance_value_commitment.IsNull() || force_unblinded)) {
127129
txin.assetIssuance.nAmount.SetToAmount(*input.m_issuance_value);
128-
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_inflation_keys_amount);
129-
} else {
130+
}
131+
else if(!input.m_issuance_value_commitment.IsNull()) {
130132
txin.assetIssuance.nAmount = input.m_issuance_value_commitment;
133+
}
134+
else {
135+
txin.assetIssuance.nAmount.SetNull();
136+
}
137+
if (input.m_issuance_inflation_keys_amount != std::nullopt && (input.m_issuance_inflation_keys_commitment.IsNull() || force_unblinded)) {
138+
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_value);
139+
}
140+
else if(!input.m_issuance_inflation_keys_commitment.IsNull()) {
131141
txin.assetIssuance.nInflationKeys = input.m_issuance_inflation_keys_commitment;
132142
}
143+
else {
144+
txin.assetIssuance.nInflationKeys.SetNull();
145+
}
133146
mtx.vin.push_back(txin);
134147
}
135148
for (const PSBTOutput& output : outputs) {
@@ -531,12 +544,9 @@ bool PSBTOutput::Merge(const PSBTOutput& output)
531544
CTxOut PSBTOutput::GetTxOut() const
532545
{
533546
assert(script != std::nullopt);
534-
if (!m_value_commitment.IsNull() && !m_asset_commitment.IsNull()) {
535-
return CTxOut(m_asset_commitment, m_value_commitment, *script);
536-
}
537-
assert(amount != std::nullopt);
538-
assert(!m_asset.IsNull());
539-
return CTxOut(CConfidentialAsset(CAsset(m_asset)), CConfidentialValue(*amount), *script);
547+
assert(amount != std::nullopt || !m_value_commitment.IsNull());
548+
assert(!m_asset.IsNull() || !m_asset_commitment.IsNull());
549+
return CTxOut(!m_asset_commitment.IsNull() ? m_asset_commitment : CAsset(m_asset), !m_value_commitment.IsNull() ? m_value_commitment : CConfidentialValue(*amount), *script);
540550
}
541551

542552
bool PSBTOutput::IsBlinded() const

src/qt/bitcoinamountfield.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class AmountSpinBox: public QAbstractSpinBox
121121
currentSingleStep = 100000000; // a whole asset
122122
}
123123
}
124-
val.second = val.second + steps * singleStep;
124+
val.second = val.second + steps * currentSingleStep;
125125
val.second = qMax(val.second, CAmount(0));
126126
val.second = qBound(m_min_amount, val.second, m_max_amount);
127127
// FIXME: Add this back in when assets can have > MAX_MONEY

src/script/interpreter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3173,7 +3173,7 @@ static bool VerifyWitnessProgram(const CScriptWitness& witness, int witversion,
31733173
}
31743174
execdata.m_tapleaf_hash_init = true;
31753175
if ((control[0] & TAPROOT_LEAF_MASK) == TAPROOT_LEAF_TAPSCRIPT) {
3176-
// Tapscript (leaf version 0xc0)
3176+
// Tapscript (leaf version 0xc4)
31773177
execdata.m_validation_weight_left = ::GetSerializeSize(witness.stack, PROTOCOL_VERSION) + VALIDATION_WEIGHT_OFFSET;
31783178
execdata.m_validation_weight_left_init = true;
31793179
return ExecuteWitnessScript(stack, exec_script, flags, SigVersion::TAPSCRIPT, checker, execdata, serror);

src/wallet/wallet.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -2048,11 +2048,15 @@ TransactionError CWallet::SignPSBT(PartiallySignedTransaction& psbtx, bool& comp
20482048
txin.assetIssuance.nAmount = input.m_issuance_value_commitment;
20492049
} else if (input.m_issuance_value) {
20502050
txin.assetIssuance.nAmount.SetToAmount(*input.m_issuance_value);
2051+
} else {
2052+
txin.assetIssuance.nAmount.SetNull();
20512053
}
20522054
if (!input.m_issuance_inflation_keys_commitment.IsNull()) {
20532055
txin.assetIssuance.nInflationKeys = input.m_issuance_inflation_keys_commitment;
20542056
} else if (input.m_issuance_inflation_keys_amount) {
20552057
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_inflation_keys_amount);
2058+
} else {
2059+
txin.assetIssuance.nInflationKeys.SetNull();
20562060
}
20572061
if (!input.m_issuance_rangeproof.empty()) {
20582062
txinwit.vchIssuanceAmountRangeproof = input.m_issuance_rangeproof;

0 commit comments

Comments
 (0)