Skip to content

Commit

Permalink
fix bug;
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Zhang committed Oct 27, 2016
1 parent 3f0e2b0 commit 98f9588
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/AntShares/Core/RegisterTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected override void DeserializeExclusiveData(BinaryReader reader)
if (Precision > 8) throw new FormatException();
if (AssetType == AssetType.Share && Precision != 0)
throw new FormatException();
if (Amount.GetData() % (long)Math.Pow(10, 8 - Precision) != 0)
if (Amount != -Fixed8.Satoshi && Amount.GetData() % (long)Math.Pow(10, 8 - Precision) != 0)
throw new FormatException();
Issuer = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);
Admin = reader.ReadSerializable<UInt160>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,10 @@ private void Persist(Block block)
{
batch.Put(SliceBuilder.Begin(DataEntryPrefix.ST_QuantityIssued).Add(quantity.Key), (GetQuantityIssued(quantity.Key) + quantity.Value).GetData());
}
current_block_hash = block.Hash;
current_block_height = block.Hash == GenesisBlock.Hash ? 0 : current_block_height + 1;
batch.Put(SliceBuilder.Begin(DataEntryPrefix.SYS_CurrentBlock), SliceBuilder.Begin().Add(block.Hash).Add(current_block_height));
batch.Put(SliceBuilder.Begin(DataEntryPrefix.SYS_CurrentBlock), SliceBuilder.Begin().Add(block.Hash).Add(block.Height));
db.Write(WriteOptions.Default, batch);
current_block_hash = block.Hash;
current_block_height = block.Height;
}

private void PersistBlocks()
Expand Down
2 changes: 1 addition & 1 deletion src/AntShares/Wallets/Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static Fixed8 CalculateClaimAmount(IEnumerable<TransactionInput> inputs)
{
Dictionary<ushort, Claimable> claimable = Blockchain.Default.GetUnclaimed(group.Key);
if (claimable == null || claimable.Count == 0)
throw new ArgumentException();
continue;
foreach (TransactionInput claim in group)
{
if (!claimable.ContainsKey(claim.PrevIndex))
Expand Down
2 changes: 1 addition & 1 deletion src/AntShares/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"authors": [ "The Antshares team" ],
"copyright": "2015-2016 The Antshares team",
"title": "AntShares",
"version": "1.1.0.4",
"version": "1.1.1.1",
"buildOptions": {
"allowUnsafe": true,
"copyToOutput": {
Expand Down

0 comments on commit 98f9588

Please sign in to comment.