Commit graph

53 commits

Author SHA1 Message Date
Mark Friedenbach
889a05fdd4 Segwit: Rename CTransaction::GetWitnessHash() -> CTransaction::GetHashWithWitness()
The upstream name of GetWitnessHash() is very confusing as it is not a hash of the witness data for the transaction, but rather a hash of the full serialization of the transaction including witness data. This goes beyond confusing to downright wrong with CT/CA where the witness hash will be a hash tree of witness data (rangeproofs, surjectionproofs, script signatures, etc.) and NOT have any transaction data.
2017-04-02 14:28:28 -04:00
Mark Friedenbach
7c35c08302 CT/CA: Unify CTxOutAsset and CTxOutValue into a single templated abstract base class 2017-04-02 14:28:18 -04:00
Mark Friedenbach
c88fec9660 CA: Move CTxOutAsset::vchSurjectionproof into CTxOut 2017-04-02 14:28:18 -04:00
Mark Friedenbach
96221efaab CT: CTxOutValue::IsAmount() -> CTxOutValue::IsExplicit() 2017-04-02 14:28:18 -04:00
Mark Friedenbach
e2077844f6 CA: CTxOutAsset::vchAssetTag -> CTxOutAsset::vchCommitment 2017-04-02 14:28:18 -04:00
Mark Friedenbach
343bf9176f CA: CTxOutAsset::IsAsset() -> CTxOutAsset::IsExplicit() 2017-04-02 14:28:18 -04:00
Mark Friedenbach
8135667a12 CA: CTxOutAsset::IsAssetCommitment() -> CTXOutAsset::IsCommitment() 2017-04-02 14:28:18 -04:00
Mark Friedenbach
c0cd48e639 CT: Remove residual code using the Elements alpha serialization prefixes 2017-04-02 14:28:18 -04:00
Mark Friedenbach
e9c8cf5051 CA: Standardize prefixes so that value and asset commitments use the same constant values for null/empty and explicit values. 2017-04-02 14:28:18 -04:00
Mark Friedenbach
31abc52e0a CA: Remove CAsset::ToString() as it is exactly identical in implementation to CAsset::GetHex(), and GetHex() more clearly matches up with the actual semantics. 2017-04-02 14:28:18 -04:00
Mark Friedenbach
944d602526 CA: Switch CTxOutAsset::GetAssetID() to return a constant reference to the stored asset ID rather than perform unnecessary memory reallocation. 2017-04-02 14:28:18 -04:00
Mark Friedenbach
b2d8685a41 CA: hashAssetIdentifier -> assetEntropy 2017-04-02 14:28:18 -04:00
Mark Friedenbach
83456d6037 CA: CAssetID -> CAsset 2017-04-02 14:28:18 -04:00
Mark Friedenbach
6e8f1b7247 CA: uint256 -> CAssetID 2017-04-02 14:25:06 -04:00
Mark Friedenbach
bdcafff6b7 2WP: Remove residual traces of bitcoin serialization from src/primitives/transaction* 2017-04-02 14:23:35 -04:00
Mark Friedenbach
f39435a877 2WP: Separate mainchain and sidechain data structures into different classes, with the bitcoin data structures living in the src/primitives/bitcoin subdirectory. 2017-04-02 14:23:35 -04:00
Mark Friedenbach
0c6d02cbaa CA: Switch to inflation-only issuance, unifying CAssetGeneration and CAssetReissuance in the process, and making serialization simpler overall. 2017-04-02 14:23:35 -04:00
Mark Friedenbach
136d7705b5 CA: Add CAssetGeneration and CAssetReissuance fields with serialization 2017-04-02 14:23:35 -04:00
Mark Friedenbach
c818b5dc14 [Move Only] Move the output definitions before the input definitions, since the asset stuff in the inputs is going to reference some of the output declarations. 2017-04-02 14:23:35 -04:00
Mark Friedenbach
610db3eb26 f "CA: Add CTxOutAsset class for holding asset tags and surjection proofs" 2017-04-02 14:23:35 -04:00
Gregory Sanders
f97475b4e5 Allow arbitrary assets for fees 2017-04-02 14:21:30 -04:00
Gregory Sanders
1dd6efe64f Disallow 0-value fees 2017-04-02 14:21:30 -04:00
Gregory Sanders
d9ab0e3edf Replace nTxFee with explicit output fees 2017-04-02 14:21:30 -04:00
Gregory Sanders
589761f799 DEMO ONLY: issuance skeleton 2017-04-02 14:21:30 -04:00
Gregory Sanders
05bc6db085 Consensus: Add asset type to CTxOut and validation 2017-04-02 14:05:25 -04:00
Mark Friedenbach
e364787b5d [Hard Fork] CA: Add asset field to CTxOut, modifying the serialization format of both transaction and witness data 2017-04-02 14:05:25 -04:00
Mark Friedenbach
f9f6503821 CA: Add CTxOutAsset class for holding asset tags and surjection proofs 2017-04-02 14:05:25 -04:00
Mark Friedenbach
f15be37b06 CT: Add CTxOutValue::SetNull for API similarity with other bitcoin classes 2017-04-02 14:05:25 -04:00
Mark Friedenbach
c127c48b85 [Move Only] CT: Move small methods of CTxOutValue class into header for inlining 2017-04-02 14:05:25 -04:00
Mark Friedenbach
1dcf7ff761 [Hard Fork] CT: Swap meaning of serialization byte for explicit outputs
Previously 0 was explicit and 1 was original bitcoin format. This has been reversed such that the original bitcoin format is 0 and the new explicit format is 1.

This is by no means a necessary change, but it is a navel gazing fix that might as well be included since the format is changing anyway to allow compact explicit amounts.
2017-04-02 14:05:25 -04:00
Mark Friedenbach
6427ee14da [Hard Fork] CT: Resize vchCommitment based on type (explicit or committed)
Previously all outputs had a fixed size (33 byte) commitment field.
With this change, explicit / unblinded outputs are serialized to 9 bytes,
saving 24 bytes of transaction space per explicit output.
2017-04-02 14:05:25 -04:00
Mark Friedenbach
78c1556679 CT: Rename nCommitmentSize -> nCommittedSize 2017-04-02 14:05:25 -04:00
instagibbs
87ccc27273 Adapt daemon functionality to updated libsecp 2017-04-02 14:05:25 -04:00
Luke Dashjr
438b0d89ae Consensus support for blinded amounts 2017-02-02 10:58:48 -05:00
Luke Dashjr
3ad6bbe651 Refactors in anticipation of blinded values 2017-02-02 10:58:48 -05:00
Matt Corallo
49f24bc6e2 Add explicit fee field to transaction 2017-02-02 10:58:48 -05:00
Pieter Wuille
1469f277d9 Get rid of CTxOut::GetHash 2016-11-01 11:48:16 -04:00
MarcoFalke
305d8ac90b Use __func__ to get function name for output printing
Github-Pull: #8548
Rebased-From: fa785d1211
2016-09-21 02:43:47 +00:00
Suhas Daftuar
fca1a415ce
Rename "block cost" to "block weight"
Github-Pull: #8363
Rebased-From: 2c06bae39e
2016-07-19 12:10:28 +02:00
Pieter Wuille
2b1f6f9ccf BIP141: Other consensus critical limits, and BIP145
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
2016-06-22 15:43:00 +02:00
Pieter Wuille
7030d9eb47 BIP144: Serialization, hashes, relay (sender side)
Contains refactorings by Eric Lombrozo.
Contains fixup by Nicolas Dorier.
Contains cleanup of CInv::GetCommand by Alex Morcos
2016-06-22 15:42:59 +02:00
Wladimir J. van der Laan
80d1f2e483
Merge #7184: Implement SequenceLocks functions for BIP 68
b043c4b fix sdaftuar's nits again (Alex Morcos)
a51c79b Bug fix to RPC test (Alex Morcos)
da6ad5f Add RPC test exercising BIP68 (mempool only) (Suhas Daftuar)
c6c2f0f Implement SequenceLocks functions (Alex Morcos)
2016-02-12 17:03:46 +01:00
Alex Morcos
c6c2f0fd78 Implement SequenceLocks functions
SequenceLocks functions are used to evaluate sequence lock times or heights per BIP 68.

The majority of this code is copied from maaku in #6312
Further credit: btcdrak, sipa, NicolasDorier
2016-02-10 15:35:33 -05:00
MarcoFalke
fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
mruddy
af3208bfa6 Resolve issue 3166.
These changes decode valid SIGHASH types on signatures in assembly (asm) representations of scriptSig scripts.
This squashed commit incorporates substantial helpful feedback from jtimon, laanwj, and sipa.
2015-07-30 19:56:00 -04:00
Pieter Wuille
9e38d0f745 Separate core memory usage computation in core_memusage.h 2015-07-20 11:17:53 -04:00
Pieter Wuille
5098c47b24 Implement accurate memory accounting for mempool 2015-07-10 10:49:31 -04:00
Wladimir J. van der Laan
5a7304b69d Move recently introduced CTransAction::IsEquivalentTo to CWalletTx
CTransAction::IsEquivalentTo was introduced in #5881.
This functionality is only useful to the wallet, and should never have
been added to the primitive transaction type.
2015-07-02 20:57:39 +02:00
Tom Harding
b2b3619262 Implement CTransaction::IsEquivalentTo(...)
Define CTransaction::IsEquivalentTo(const CTransaction& tx)

True if only scriptSigs are different.  In other words, true if
the two transactions are malleability clones.  In other words,
true if the two transactions have the same effect on the
outside universe.

In the wallet, only SyncMetaData for equivalent transactions.
2015-04-11 19:03:58 -07:00
Pavel Janík
5262fde0ec Remove whitespaces before double colon in errors and logs 2015-01-31 17:38:28 -05:00