Skip to content

Commit

Permalink
remove useless cast in BitcoinStream
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier committed Oct 31, 2014
1 parent 52da25c commit 665e542
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions NBitcoin.Tests/transaction_tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,6 @@ private void AssertCorrectlySigned(Transaction tx, Script scriptPubKey)
[Trait("UnitTest", "UnitTest")]
public void CanUseLockTime()
{
//LockTime lockTime = new LockTime(5);
//var bytes = lockTime.ToBytes();

//LockTime cloneLockTime = default(LockTime);
//new BitcoinStream(bytes).ReadWrite(ref cloneLockTime);

var tx = new Transaction();
tx.LockTime = new LockTime(4);
var clone = tx.Clone();
Expand Down
2 changes: 1 addition & 1 deletion NBitcoin/BitcoinStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void ReadWrite(ref bool data)
{
if(data == null)
data = Activator.CreateInstance<T>();
((IBitcoinSerializable)data).ReadWrite(this);
data.ReadWrite(this);
}

public void ReadWrite<T>(ref List<T> list) where T : IBitcoinSerializable, new()
Expand Down
2 changes: 1 addition & 1 deletion NBitcoin/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ public void ReadWrite(BitcoinStream stream)
stream.ReadWrite(ref nVersion);
stream.ReadWrite(ref vin);
stream.ReadWrite(ref vout);
nLockTime.ReadWrite(stream);
stream.ReadWrite(ref nLockTime);
}

#endregion
Expand Down

0 comments on commit 665e542

Please sign in to comment.