Commit graph

192 commits

Author SHA1 Message Date
Gregory Sanders
1381c68e1b
Merge #359: Rework control flow in VerifyAmount()
05602ed Improve comments for VerifyAmount() (Tim Ruffing)
42b62ac Ensure that input witness is present before accessing range proofs (Tim Ruffing)
670229e Use new helper function to verify issuance of re-issuance tokens (Tim Ruffing)
d7abf18 Extract helper function from VerifyAmount() (Tim Ruffing)
e183868 Forbid explicit issuance of 0 asset units (Tim Ruffing)
bef2760 Assert return value of secp256k1_pedersen_commit() for issuances (Tim Ruffing)
46f2416 Remove old testing code (Tim Ruffing)
2018-05-29 13:19:23 -04:00
Tim Ruffing
b2a729c4a5 Remove overflow checks for explicit input amounts
This removes checks from the pre-asset era that reject amounts on the
input side of a transaction if these amounts overflow. The checks are
superficial because VerifyAmounts() already rejects input amounts that
could potentially overflow.

One of the removed checks is wrong because it rejects legitimate
transactions that spend more than MAX_MONEY asset units altogether,
even if those units belong to different assets. For example, a
transaction spending MAX_MONEY units of an asset "apple" and MAX_MONEY
units of an asset "orange" was previously rejected because the code
literally added apples and oranges in this case.
2018-05-25 18:51:48 +02:00
Tim Ruffing
05602edf6f Improve comments for VerifyAmount() 2018-05-24 22:17:51 +02:00
Tim Ruffing
42b62ac285 Ensure that input witness is present before accessing range proofs 2018-05-24 22:17:51 +02:00
Tim Ruffing
670229e060 Use new helper function to verify issuance of re-issuance tokens
This forbids the explicit issuance of 0 re-issuance tokens (like for the issuance of
normal assets. The proper way to issue no re-issuance tokens is to use a
null commitment for the amount.
2018-05-24 22:17:51 +02:00
Tim Ruffing
d7abf1870a Extract helper function from VerifyAmount() 2018-05-24 22:17:51 +02:00
Tim Ruffing
e183868516 Forbid explicit issuance of 0 asset units
The proper way to issue 0 units of an asset is a null commitment but not
an explicit commitment to 0.

This commit eliminates the issue that some checks in the verification of
the issuance of re-issuance tokes were skipped when issuing 0 asset units
explicitly. This commit also simplifies the control flow of the relevant
code locations.
2018-05-24 22:17:51 +02:00
Tim Ruffing
bef2760352 Assert return value of secp256k1_pedersen_commit() for issuances
secp256k1_pedersen_commit() is expected to succeed because the value and
the blinding factor are both 0.
2018-05-24 22:09:41 +02:00
Gregory Sanders
d77df82196 parameterize the mandatory coinbase 2018-04-02 13:40:49 -07:00
Gregory Sanders
b628d91894 make peginconfirmationdepth a chain param 2018-03-28 12:47:25 -04:00
Gregory Sanders
e348f8248e simplify non-depth peg-in validity checking 2018-03-28 10:01:14 -04:00
Gregory Sanders
2d1a092ff2 fix segfault when block from disk has pegin failure 2018-03-26 12:18:57 -04:00
Gregory Sanders
fa34426ab1 remove witnessEnabled standardness logic 2018-03-13 12:20:24 -04:00
Gregory Sanders
d74234b422 commit genesis block transactions to txindex 2018-01-23 09:11:59 -05:00
Gregory Sanders
2ccbf87b04 skip balance checks when assumevalid is active 2017-12-11 11:00:55 -05:00
Gregory Sanders
7c7e23b898 HF: peg-in outputs in parent chain are p2sh-pw2sh 2017-11-07 17:34:12 -05:00
Gregory Sanders
da6960ddb7 validation variables changed to not assume witness program for pegin 2017-11-06 10:54:51 -05:00
Gregory Sanders
2940c4e0ea remove tabs from IsValidPegin 2017-11-06 10:54:51 -05:00
Gregory Sanders
7dc4f9d442 remove CNumScript from pegin witness logic 2017-11-06 10:54:51 -05:00
Gregory Sanders
abafbacd82 change rpc test witness_program to claim_script 2017-11-06 10:54:51 -05:00
Gregory Sanders
851a30b266 Don't restrict pegin witness to 'witness program' definition 2017-11-06 10:54:51 -05:00
Gregory Sanders
13c3dad52f de-dupe calculate_contract code 2017-11-06 10:54:51 -05:00
Gregory Sanders
4aad513939 Add unit tests for peg-in authorization 2017-11-06 10:54:51 -05:00
Gregory Sanders
ff5e9cd74d mempool and policy support for peg-in inputs 2017-11-06 10:54:50 -05:00
Gregory Sanders
6bad4e9d75 add blocks that have pegins rejected to the reconsider queue 2017-11-06 10:54:50 -05:00
Gregory Sanders
0b9c5eb0e0 begin consensus support for peg-ins 2017-11-06 10:54:50 -05:00
Gregory Sanders
34d7cd072f add pegin witness validation and extraction helper functions 2017-11-06 10:13:28 -05:00
Gregory Sanders
9a9ac25ee1 genesis block has actual fee issuance in regtest 2017-11-06 09:51:52 -05:00
Gregory Sanders
65ed777e6e remove legacy peg-in/withdrawlocks 2017-11-06 09:51:45 -05:00
Jorge Timón
a730159690
p2p: Remove opt-in part of RBF 2017-10-01 00:56:15 +02:00
Jorge Timón
e17e0b81b6
Remove -mempoolreplacement option 2017-09-23 09:27:17 +02:00
Gregory Sanders
9a0ff5c7f6
Merge #221: CSurjectionCheck copies vector instead of swapping
87c1fc2 CSurjectionCheck copies vector instead of swapping (Gregory Sanders)
2017-09-22 11:34:45 -04:00
Gregory Sanders
87c1fc29af CSurjectionCheck copies vector instead of swapping 2017-09-22 11:03:35 -04:00
Gregory Sanders
224f7b83be remove asserts from verifyamounts, test commitment types 2017-09-21 10:14:34 -04:00
Arvid Norberg
d8a18ef34f fix incorrect bounds check to wit.vtxinwit access in ContextualCheckBlock 2017-09-08 00:02:24 +02:00
Gregory Sanders
ae1f058433 Only use chainparams to access BITCOINID as pegged_asset 2017-08-24 14:30:35 -04:00
Gregory Sanders
cf9efd84fc Merge pull request #220 from instagibbs/revertcheck
Revert ownership of CCheck to QueueCheck, return ScriptError
2017-08-03 10:02:31 +09:00
Gregory Sanders
9823c8889c Allow mempool withdrawlocks to be grabbed by clients during pegin 2017-07-25 18:55:15 -04:00
Gregory Sanders
29b1f21c77 Free relay reserved entirely for withdrawlock spends, not rate limited 2017-07-19 10:31:09 -04:00
Gregory Sanders
f3a4e5b798 Revert ownership of CCheck to QueueCheck, return ScriptError 2017-07-18 21:58:42 -04:00
Karl-Johan Alm
0cd7cc16d3
bad-txns-in-belowout -> bad-txns-in-ne-out
The error message indicates that the inputs exceed the outputs. In reality, at least for blinded transactions, the error will also appear if the in exceeds the out, i.e. this error appears for all transactions where inputs do not sum up to outputs.
2017-07-12 17:50:17 +09:00
Gregory Sanders
a288fff697 Only track locks with explicit asset types that are bitcoin 2017-06-16 12:02:37 -04:00
Jorge Timón
21620bd6ab Document -validatepegin in daemon help 2017-06-16 12:02:37 -04:00
Gregory Sanders
da87a78f98 give more accurate message for invalid block proof 2017-06-16 12:02:36 -04:00
Gregory Sanders
0bb5e092f3 f'Remove spendable 0-value outputs from consensus, wallet' 2017-06-16 12:02:36 -04:00
Gregory Sanders
4c33b2df83 f'Greatly simplify coinbase balance checking' 2017-06-16 12:02:36 -04:00
Gregory Sanders
6c3b1f25c0 Move asset issuance funcionality to own file 2017-06-16 12:02:35 -04:00
Gregory Sanders
05b245b9b5 CAssetIssuance validation 2017-06-16 12:02:35 -04:00
Mark Friedenbach
b4be08a70d Format: Fix indentation 2017-06-16 12:02:35 -04:00
Mark Friedenbach
91f40de0c5 CT: Switch to standard CConfidentialValue::IsCommitment() API instead checking the size of the commitment vector directly 2017-06-16 12:02:34 -04:00