X-Git-Url: https://git.novaco.in/?p=NovacoinLibrary.git;a=blobdiff_plain;f=Novacoin%2FDatabaseObjects.cs;h=a78f93b4135271dfeaff1d285698f2b7316b5591;hp=b49d63e80338538883ab21ef06259135e1540463;hb=183708642533185adadd50c36470927d8dd4b914;hpb=86473a10fbebca1b501bd140a5589f08a39311da diff --git a/Novacoin/DatabaseObjects.cs b/Novacoin/DatabaseObjects.cs index b49d63e..a78f93b 100644 --- a/Novacoin/DatabaseObjects.cs +++ b/Novacoin/DatabaseObjects.cs @@ -566,6 +566,12 @@ namespace Novacoin public long nParentBlockID { get; set; } /// + /// Transaction timestamp + /// + [Column("nTime")] + public uint nTime { get; set; } + + /// /// Transaction type flag /// [Column("TransactionFlags")] @@ -647,8 +653,22 @@ namespace Novacoin private set { TxSize = VarInt.EncodeVarInt(value); } } + [Ignore] + public bool IsCoinBase + { + get { return TransactionFlags == TxFlags.TX_COINBASE; } + } + + [Ignore] + public bool IsCoinStake + { + get { return TransactionFlags == TxFlags.TX_COINSTAKE; } + } + public CMerkleNode(CTransaction tx) { + nTime = tx.nTime; + nTxOffset = -1; nParentBlockID = -1; @@ -657,20 +677,22 @@ namespace Novacoin if (tx.IsCoinBase) { - TransactionFlags |= TxFlags.TX_COINBASE; + TransactionFlags = TxFlags.TX_COINBASE; } else if (tx.IsCoinStake) { - TransactionFlags |= TxFlags.TX_COINSTAKE; + TransactionFlags = TxFlags.TX_COINSTAKE; } else { - TransactionFlags |= TxFlags.TX_USER; + TransactionFlags = TxFlags.TX_USER; } } public CMerkleNode(long nBlockId, long nOffset, CTransaction tx) { + nTime = tx.nTime; + nParentBlockID = nBlockId; nTxOffset = nOffset;