fix typo ’transaction‘

This commit is contained in:
yjjnls 2019-03-09 15:25:14 +08:00
parent 05a373e36b
commit 33af66d19c
3 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@ var Block = require("./block");
const genesis_block = require("./genesis_block.json"); const genesis_block = require("./genesis_block.json");
var Node = require("./network"); var Node = require("./network");
var Account = require("./account"); var Account = require("./account");
var Transcation = require("./transcation"); var Transaction = require("./transaction");
var Msg = require("./message"); var Msg = require("./message");
var MessageType = require("./message").type; var MessageType = require("./message").type;
var Promise = require("bluebird"); var Promise = require("bluebird");
@ -158,7 +158,7 @@ class BlockChain {
let tx = block.transcations; let tx = block.transcations;
for (var i = 0; i < tx.length; ++i) { for (var i = 0; i < tx.length; ++i) {
// todo (check tx is exist and valid) // todo (check tx is exist and valid)
if (!Transcation.verify(tx[i])) if (!Transaction.verify(tx[i]))
return false; return false;
} }
return true; return true;
@ -192,7 +192,7 @@ class BlockChain {
this.broadcast(msg); this.broadcast(msg);
} }
break; break;
case MessageType.Transcation: case MessageType.Transaction:
{ {
// check if exist(pending or in chain) verify, store(into pending) and broadcast // check if exist(pending or in chain) verify, store(into pending) and broadcast
} }

View File

@ -3,7 +3,7 @@
var MessageType = { var MessageType = {
Connection: 0, Connection: 0,
Block: 1, Block: 1,
Transcation: 2, Transaction: 2,
PrePrepare: 3, PrePrepare: 3,
Prepare: 4, Prepare: 4,
Commit: 5 Commit: 5

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
class Transcation { class Transaction {
constructor() { constructor() {
} }
@ -10,4 +10,4 @@ class Transcation {
} }
} }
module.exports = Transcation; module.exports = Transaction;