NovacoinLibrary.git
4 years agoTrimArray() simplification master
CryptoManiac [Wed, 16 Sep 2015 13:45:51 +0000]
TrimArray() simplification

4 years agonBlockTrust cleanup.
CryptoManiac [Wed, 16 Sep 2015 12:51:18 +0000]
nBlockTrust cleanup.

4 years agoRemove legacy stake reward calculation code.
CryptoManiac [Wed, 16 Sep 2015 12:43:14 +0000]
Remove legacy stake reward calculation code.

This commit is similar to this one.

https://github.com/novacoin-project/novacoin/commit/8118d1168e4e3f87f8d19c58ec3cce36eccdb92b

4 years agoCosmetic changes.
CryptoManiac [Tue, 15 Sep 2015 06:30:02 +0000]
Cosmetic changes.

4 years agoEnforce rule that the coinbase starts with serialized block height.
CryptoManiac [Mon, 14 Sep 2015 11:35:55 +0000]
Enforce rule that the coinbase starts with serialized block height.

4 years agoDon't calculate sigops for coinbase scriptsig.
CryptoManiac [Sun, 13 Sep 2015 14:33:51 +0000]
Don't calculate sigops for coinbase scriptsig.

4 years agoUse Low32 property.
CryptoManiac [Sat, 12 Sep 2015 14:15:13 +0000]
Use Low32 property.

4 years agoCorrect calculation of modifier checksums.
CryptoManiac [Sat, 12 Sep 2015 14:11:22 +0000]
Correct calculation of modifier checksums.

4 years agoAdd stake modifier checkpoints & do some cleanup
CryptoManiac [Sat, 12 Sep 2015 13:49:30 +0000]
Add stake modifier checkpoints & do some cleanup

4 years agoUse Checkpoints.Verify to verify whether hash contradicts the table of checkpoints...
CryptoManiac [Sat, 12 Sep 2015 12:03:56 +0000]
Use Checkpoints.Verify to verify whether hash contradicts the table of checkpoints or not.

4 years agoAdd checkpoint at block #200000
CryptoManiac [Fri, 11 Sep 2015 21:53:30 +0000]
Add checkpoint at block #200000

4 years agoUse signed 64 bit integers for better compatibility.
CryptoManiac [Fri, 11 Sep 2015 17:03:05 +0000]
Use signed 64 bit integers for better compatibility.

4 years agoLimit duplicity on stake & Process orphans only if there are some.
CryptoManiac [Thu, 10 Sep 2015 22:26:54 +0000]
Limit duplicity on stake & Process orphans only if there are some.

4 years agoDon't check proof-of-stake signature twice.
CryptoManiac [Thu, 10 Sep 2015 19:08:11 +0000]
Don't check proof-of-stake signature twice.

4 years agoCheckProofOfWork should be static.
CryptoManiac [Thu, 10 Sep 2015 17:34:43 +0000]
CheckProofOfWork should be static.

4 years agoMinor cleanup
CryptoManiac [Thu, 10 Sep 2015 17:26:13 +0000]
Minor cleanup

4 years agoUse GetProofOfStakeHash
CryptoManiac [Thu, 10 Sep 2015 00:32:18 +0000]
Use GetProofOfStakeHash

4 years agoSave proof-of-stake kernel hash.
CryptoManiac [Wed, 9 Sep 2015 23:55:07 +0000]
Save proof-of-stake kernel hash.

4 years agoReplace ref with out in the stake modifier calculation method.
CryptoManiac [Wed, 9 Sep 2015 23:10:45 +0000]
Replace ref with out in the stake modifier calculation method.

4 years agoFix multiplication bug.
CryptoManiac [Wed, 9 Sep 2015 23:09:15 +0000]
Fix multiplication bug.

4 years agoFlush cursor item directrly to resolve syncronization issues. Not so fast, but at...
CryptoManiac [Wed, 9 Sep 2015 21:36:28 +0000]
Flush cursor item directrly to resolve syncronization issues. Not so fast, but at least it works well.

TODO: A proper delayed item update implementation.

4 years agoFix txpos calculation issue and use out instead of ref for stake hash and target...
CryptoManiac [Wed, 9 Sep 2015 20:27:15 +0000]
Fix txpos calculation issue and use out instead of ref for stake hash and target values.

4 years agoAdd vtx.Length value to output.
CryptoManiac [Wed, 9 Sep 2015 20:20:16 +0000]
Add vtx.Length value to output.

4 years agoYet another bugfix. :)
CryptoManiac [Wed, 9 Sep 2015 19:41:01 +0000]
Yet another bugfix. :)

4 years agoFix issue with connecting same-block-confirmed inputs.
CryptoManiac [Wed, 9 Sep 2015 11:30:04 +0000]
Fix issue with connecting same-block-confirmed inputs.

TODO: Ensure that neither coinbase nor coinstake outputs are
   available for spending in the generation block.

4 years agoUse BigNum for rewards calculation.
CryptoManiac [Wed, 9 Sep 2015 08:48:38 +0000]
Use BigNum for rewards calculation.

4 years agoIEquatable, IComparable implementation.
CryptoManiac [Wed, 9 Sep 2015 08:48:04 +0000]
IEquatable, IComparable implementation.

4 years agoAdd wrapper for BouncyCastle's BigInteger.
CryptoManiac [Wed, 9 Sep 2015 08:23:56 +0000]
Add wrapper for BouncyCastle's BigInteger.

4 years agoAdd incompatibility notice.
CryptoManiac [Tue, 8 Sep 2015 23:07:48 +0000]
Add incompatibility notice.

System.Numerics based implementation of GetProofOfWorkReward function produces incorrect reward values.

OpenSSL:

```
bnUpperBound=100000000, bnLowerBound=50005000, bnMidValue=50005000
bnUpperBound=75002500, bnLowerBound=50005000, bnMidValue=75002500
bnUpperBound=62503750, bnLowerBound=50005000, bnMidValue=62503750
bnUpperBound=56254375, bnLowerBound=50005000, bnMidValue=56254375
bnUpperBound=56254375, bnLowerBound=53129687, bnMidValue=53129687
bnUpperBound=54692031, bnLowerBound=53129687, bnMidValue=54692031
bnUpperBound=54692031, bnLowerBound=53910859, bnMidValue=53910859
bnUpperBound=54301445, bnLowerBound=53910859, bnMidValue=54301445
bnUpperBound=54301445, bnLowerBound=54106152, bnMidValue=54106152
bnUpperBound=54301445, bnLowerBound=54203798, bnMidValue=54203798
bnUpperBound=54301445, bnLowerBound=54252621, bnMidValue=54252621
bnUpperBound=54301445, bnLowerBound=54277033, bnMidValue=54277033
bnUpperBound=54301445, bnLowerBound=54289239, bnMidValue=54289239
bnUpperBound=54295342, bnLowerBound=54289239, bnMidValue=54295342
```

System.Numerics:

```
bnUpperBound=100000000 bnLowerBound=50005000 bnMidValue=50005000
bnUpperBound=75002500 bnLowerBound=50005000 bnMidValue=75002500
bnUpperBound=62503750 bnLowerBound=50005000 bnMidValue=62503750
bnUpperBound=56254375 bnLowerBound=50005000 bnMidValue=56254375
bnUpperBound=56254375 bnLowerBound=53129687 bnMidValue=53129687
bnUpperBound=54692031 bnLowerBound=53129687 bnMidValue=54692031
bnUpperBound=54692031 bnLowerBound=53910859 bnMidValue=53910859
bnUpperBound=54301445 bnLowerBound=53910859 bnMidValue=54301445
bnUpperBound=54301445 bnLowerBound=54106152 bnMidValue=54106152
bnUpperBound=54301445 bnLowerBound=54203798 bnMidValue=54203798
bnUpperBound=54301445 bnLowerBound=54252621 bnMidValue=54252621
bnUpperBound=54301445 bnLowerBound=54277033 bnMidValue=54277033
bnUpperBound=54301445 bnLowerBound=54289239 bnMidValue=54289239
bnUpperBound=54301445 bnLowerBound=54295342 bnMidValue=54295342
```

4 years agogetTxOutItem()
CryptoManiac [Tue, 8 Sep 2015 20:06:08 +0000]
getTxOutItem()

4 years agoIssue to be dealt with in the near future.
CryptoManiac [Mon, 7 Sep 2015 22:33:16 +0000]
Issue to be dealt with in the near future.

4 years agoFix merkleNode exceptions.
CryptoManiac [Mon, 7 Sep 2015 22:04:32 +0000]
Fix merkleNode exceptions.

4 years agoGetCoinAge
CryptoManiac [Mon, 7 Sep 2015 21:47:13 +0000]
GetCoinAge

4 years agoGetMinTxFee & use unsigned int for sizes.
CryptoManiac [Mon, 7 Sep 2015 21:30:19 +0000]
GetMinTxFee & use unsigned int for sizes.

4 years agoGetProofOfStakeReward
CryptoManiac [Mon, 7 Sep 2015 21:05:50 +0000]
GetProofOfStakeReward

4 years agoConnectInputs + stubs for GetCoinAge, GetMinFee and GetProofOfStakeReward.
CryptoManiac [Mon, 7 Sep 2015 17:27:36 +0000]
ConnectInputs + stubs for GetCoinAge, GetMinFee and GetProofOfStakeReward.

4 years agoRun block addition database operations in single transaction.
CryptoManiac [Mon, 7 Sep 2015 15:57:14 +0000]
Run block addition database operations in single transaction.

4 years agoCalculation of ValueIn and nSigops, implementation of IEqualityComparer<COutPoint>
CryptoManiac [Mon, 7 Sep 2015 14:49:52 +0000]
Calculation of ValueIn and nSigops, implementation of IEqualityComparer<COutPoint>

4 years agoRemove interfaces, split database objects into new file.
CryptoManiac [Mon, 7 Sep 2015 13:46:03 +0000]
Remove interfaces, split database objects into new file.

4 years agoSave best height, best hash and best trust.
CryptoManiac [Mon, 7 Sep 2015 12:06:46 +0000]
Save best height, best hash and best trust.

4 years agoAdd checkpoints file.
CryptoManiac [Mon, 7 Sep 2015 09:40:49 +0000]
Add checkpoints file.

4 years agoCheckpoints valudation, PoW reward calculation and continue working on block index.
CryptoManiac [Sun, 6 Sep 2015 22:24:14 +0000]
Checkpoints valudation, PoW reward calculation and continue working on block index.

4 years agoWorking on Reorganize implementation.
CryptoManiac [Sun, 6 Sep 2015 14:12:18 +0000]
Working on Reorganize implementation.

4 years agoFetchInputs
CryptoManiac [Sun, 6 Sep 2015 10:58:28 +0000]
FetchInputs

4 years agoBeginning of FetchInputs implementation.
CryptoManiac [Sun, 6 Sep 2015 00:49:33 +0000]
Beginning of FetchInputs implementation.

4 years agoBugfix
CryptoManiac [Sat, 5 Sep 2015 22:07:00 +0000]
Bugfix

4 years agoNewtonsoft.Json assembly reference.
CryptoManiac [Sat, 5 Sep 2015 17:17:10 +0000]
Newtonsoft.Json assembly reference.

4 years agoFew new structures to be used in the near future.
CryptoManiac [Sat, 5 Sep 2015 17:11:43 +0000]
Few new structures to be used in the near future.

4 years agoValueOut property.
CryptoManiac [Sat, 5 Sep 2015 13:42:24 +0000]
ValueOut property.

4 years agoStatic methods for output array serialization/deserialization.
CryptoManiac [Sat, 5 Sep 2015 13:39:32 +0000]
Static methods for output array serialization/deserialization.

4 years agoStatic methods for output array serialization and deserialization.
CryptoManiac [Sat, 5 Sep 2015 13:37:32 +0000]
Static methods for output array serialization and deserialization.

4 years agoFix integer overflow issue.
CryptoManiac [Fri, 4 Sep 2015 13:20:10 +0000]
Fix integer overflow issue.

4 years agoInitial implementation of stake modifier calculation.
CryptoManiac [Thu, 3 Sep 2015 22:06:46 +0000]
Initial implementation of stake modifier calculation.

Note that this functionality doesn't work properly yet.

4 years agoChain trust score computation.
CryptoManiac [Thu, 3 Sep 2015 19:59:58 +0000]
Chain trust score computation.

4 years agoStakeModifier: remove BigInteger dependency
CryptoManiac [Thu, 3 Sep 2015 18:41:01 +0000]
StakeModifier: remove BigInteger dependency

4 years agouint -> ulong
CryptoManiac [Thu, 3 Sep 2015 18:27:30 +0000]
uint -> ulong

4 years agoMultiplication operator for uint160/uint256.
CryptoManiac [Thu, 3 Sep 2015 18:18:56 +0000]
Multiplication operator for uint160/uint256.

4 years agouint160 and uint256 division operations.
CryptoManiac [Thu, 3 Sep 2015 17:03:14 +0000]
uint160 and uint256 division operations.

4 years agonChainChecksSwitchTime comstant.
CryptoManiac [Thu, 3 Sep 2015 15:52:30 +0000]
nChainChecksSwitchTime comstant.

4 years agouint256 division stub
CryptoManiac [Thu, 3 Sep 2015 14:58:07 +0000]
uint256 division stub

4 years agoImplementation of operator* for uint160 and uint256.
CryptoManiac [Thu, 3 Sep 2015 12:56:38 +0000]
Implementation of operator* for uint160 and uint256.

4 years agoAdd operator% for uint160 and uint256.
CryptoManiac [Thu, 3 Sep 2015 12:02:02 +0000]
Add operator% for uint160 and uint256.

4 years agooperator/ for uint160 and uint256
CryptoManiac [Thu, 3 Sep 2015 10:48:41 +0000]
operator/ for uint160 and uint256

4 years agoIsInMainChain property
CryptoManiac [Wed, 2 Sep 2015 22:49:35 +0000]
IsInMainChain property

4 years agoStakeModifier class.
CryptoManiac [Wed, 2 Sep 2015 22:38:02 +0000]
StakeModifier class.

Extremely experimental and not tested yet.

4 years agoFix
CryptoManiac [Wed, 2 Sep 2015 21:04:15 +0000]
Fix

4 years agoAdd new block cursor helper properties, start implementation of StakeModifier calcula...
CryptoManiac [Wed, 2 Sep 2015 20:39:08 +0000]
Add new block cursor helper properties, start implementation of StakeModifier calculation.

4 years agoAdd stake entropy bit generation.
CryptoManiac [Wed, 2 Sep 2015 17:40:26 +0000]
Add stake entropy bit generation.

4 years agoVerification of claimed Proof-of-Work.
CryptoManiac [Wed, 2 Sep 2015 16:47:59 +0000]
Verification of claimed Proof-of-Work.

4 years agoTypo.
CryptoManiac [Wed, 2 Sep 2015 16:21:46 +0000]
Typo.

4 years agoRemove Hash, Hash256, Hash160 and ScryptHash256 classes.
CryptoManiac [Wed, 2 Sep 2015 14:01:29 +0000]
Remove Hash, Hash256, Hash160 and ScryptHash256 classes.

4 years agoRemove RIPEMD160, SHA1 and SHA256 classes.
CryptoManiac [Wed, 2 Sep 2015 10:18:49 +0000]
Remove RIPEMD160, SHA1 and SHA256 classes.

4 years agoImprove CryptoUtils with wrappers for managed implementations of standard hashing...
CryptoManiac [Wed, 2 Sep 2015 10:16:29 +0000]
Improve CryptoUtils with wrappers for managed implementations of standard hashing functions.

4 years agoImplementation of IEquatable<base_uint> and IEqualityComparer<base_uint>, derive...
CryptoManiac [Wed, 2 Sep 2015 08:32:45 +0000]
Implementation of IEquatable<base_uint> and IEqualityComparer<base_uint>, derive KeyID and ScriptID form uint160.

4 years agoRedefine uint160.nWidth, uint160.pn, uint256.nWidth and uint256.pn as protected prope...
CryptoManiac [Wed, 2 Sep 2015 07:16:53 +0000]
Redefine uint160.nWidth, uint160.pn, uint256.nWidth and uint256.pn as protected properties to make the derivals easier.

4 years agoDescription fix.
CryptoManiac [Wed, 2 Sep 2015 06:03:43 +0000]
Description fix.

4 years agoAdd Compact property to uint256.
CryptoManiac [Tue, 1 Sep 2015 21:04:04 +0000]
Add Compact property to uint256.

4 years agoHACK: initialize base.nWidth to resolve comparison issues.
CryptoManiac [Tue, 1 Sep 2015 19:06:48 +0000]
HACK: initialize base.nWidth to resolve comparison issues.

4 years agoComplete implementation of uint256 and uint160 classes.
CryptoManiac [Tue, 1 Sep 2015 18:52:39 +0000]
Complete implementation of uint256 and uint160 classes.

4 years agoOverride Equals(object)
CryptoManiac [Tue, 1 Sep 2015 17:46:04 +0000]
Override Equals(object)

4 years agoOverload basic operations with base_uint class.
CryptoManiac [Tue, 1 Sep 2015 17:10:23 +0000]
Overload basic operations with base_uint class.

4 years agostubs for uint256/uint160
CryptoManiac [Tue, 1 Sep 2015 15:09:47 +0000]
stubs for uint256/uint160

4 years agoPreliminary block checkings.
CryptoManiac [Tue, 1 Sep 2015 10:27:06 +0000]
Preliminary block checkings.

4 years agonMaxSigOps constant.
CryptoManiac [Tue, 1 Sep 2015 08:48:13 +0000]
nMaxSigOps constant.

4 years agoYet another cosmetic change.
CryptoManiac [Tue, 1 Sep 2015 07:20:41 +0000]
Yet another cosmetic change.

4 years agoCosmetic changes.
CryptoManiac [Tue, 1 Sep 2015 07:12:42 +0000]
Cosmetic changes.

4 years agoReplace ByteQueue with its simplified version, InstructionQueue, since it's used...
CryptoManiac [Mon, 31 Aug 2015 23:00:37 +0000]
Replace ByteQueue with its simplified version, InstructionQueue, since it's used for scripts only.

Add new internal constructor for block header class.

4 years agoReplace CTransaction constructor with MemoryStream based implementation.
CryptoManiac [Mon, 31 Aug 2015 22:08:51 +0000]
Replace CTransaction constructor with MemoryStream based implementation.

4 years agoReadTxInList, ReadTxOutList and ReadTxList are internal now.
CryptoManiac [Mon, 31 Aug 2015 20:52:23 +0000]
ReadTxInList, ReadTxOutList and ReadTxList are internal now.

4 years agoCBlock: serialization
CryptoManiac [Mon, 31 Aug 2015 18:29:23 +0000]
CBlock: serialization

4 years agoFix serialization issue.
CryptoManiac [Mon, 31 Aug 2015 16:33:37 +0000]
Fix serialization issue.

4 years agoMerge branch 'master' of https://github.com/CryptoManiac/NovacoinLibrary
CryptoManiac [Mon, 31 Aug 2015 16:27:38 +0000]
Merge branch 'master' of https://github.com/CryptoManiac/NovacoinLibrary

Conflicts:
Novacoin/CBlockStore.cs

4 years agoTurn ByteQueue into MemoryStream wrapper, use MemoryStream for serialization of COutP...
CryptoManiac [Mon, 31 Aug 2015 16:24:53 +0000]
Turn ByteQueue into MemoryStream wrapper, use MemoryStream for serialization of COutPoint/CTxIn/CTxOut/CTransaction objects.

4 years agoDispose writable stream properly.
CryptoManiac [Mon, 31 Aug 2015 10:41:07 +0000]
Dispose writable stream properly.

4 years agoBlock serialization + copile error fixes.
CryptoManiac [Mon, 31 Aug 2015 09:02:40 +0000]
Block serialization + copile error fixes.

4 years agoBlock and transaction verifications
CryptoManiac [Mon, 31 Aug 2015 03:49:55 +0000]
Block and transaction verifications

There are still a lot of things labeled with TODO tag, though.

4 years agoCopy&paste typo fix
CryptoManiac [Sun, 30 Aug 2015 17:43:46 +0000]
Copy&paste typo fix

4 years agoMerge branch 'master' of https://github.com/CryptoManiac/NovacoinLibrary
CryptoManiac [Sun, 30 Aug 2015 17:42:00 +0000]
Merge branch 'master' of https://github.com/CryptoManiac/NovacoinLibrary

Conflicts:
Novacoin/CTransaction.cs

4 years agoTransaction script verification, unserealize exceptions
CryptoManiac [Sun, 30 Aug 2015 17:35:43 +0000]
Transaction script verification, unserealize exceptions

Also, very simple and ugly blockfile reader. Only consequent reading is supported for now.

4 years agoToInt64 -> ToUInt64
CryptoManiac [Sun, 30 Aug 2015 05:29:16 +0000]
ToInt64 -> ToUInt64