File tree 3 files changed +6
-4
lines changed
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ MOM.verifyActionList = async function () {
150
150
for ( let count = 0 ; count < 4 ; count ++ ) {
151
151
var missAction = await wo . Peer . call ( '/Action/getAction' , { Action : { hash : actionHash } } )
152
152
if ( missAction ) {
153
- if ( wo [ missAction . type ] . validater ( missAction ) ) {
153
+ if ( wo [ missAction . type ] . validate ( missAction ) ) {
154
154
await wo [ missAction . type ] . execute ( missAction ) // 执行该Action
155
155
await wo [ missAction . type ] . addOne ( { [ missAction . type ] : missAction } ) // 加入Action表
156
156
}
Original file line number Diff line number Diff line change @@ -329,12 +329,12 @@ POT.mineOnce = async function () {
329
329
my . currentPhase = 'mining'
330
330
mylog . info ( '<====== 出块阶段 ======>' )
331
331
let canMine = Date . time2height ( ) === ( await wo . Chain . getTopBlock ( ) ) . height + 1
332
- mylog . info ( `可否出块 : ${ canMine } ` )
332
+ mylog . info ( `是否在正常出块阶段 : ${ canMine } ` )
333
333
if ( canMine ) {
334
334
mylog . info ( new Date ( ) + ':出块阶段开始 for block=' + ( ( await wo . Chain . getTopBlock ( ) ) . height + 1 ) + ' using block=' + ( await wo . Chain . getTopBlock ( ) ) . height )
335
335
mylog . info ( '本节点的候选签名=' + my . selfPot . signature + ',来自地址地址 ' + wo . Crypto . pubkey2address ( my . selfPot . pubkey ) )
336
336
mylog . info ( '全网最终获胜签名=' + my . bestPot . signature + ',来自地址地址 ' + wo . Crypto . pubkey2address ( my . bestPot . pubkey ) )
337
- if ( my . selfPot . signature && my . bestPot . signature === my . selfPot . signature ) { // 全网最终获胜者是我自己,于是打包并广播。注意防止 bestPot===selfPot===undefined,这是跳过竞选阶段直接从前两阶段开始会发生的。
337
+ if ( my . selfPot . signature && my . selfPot . pubkey && my . selfPot . signature === my . bestPot . signature && my . selfPot . pubkey === my . bestPot . pubkey ) { // 全网最终获胜者是我自己,于是打包并广播。注意防止 bestPot===selfPot===undefined,这是跳过竞选阶段直接从前两阶段开始会发生的。
338
338
mylog . info ( '本节点获胜,开始出块...' )
339
339
let newBlock = await wo . Chain . createBlock ( {
340
340
winnerMessage : my . selfPot . message ,
Original file line number Diff line number Diff line change @@ -368,10 +368,12 @@ SocCluster.prototype.addEventHandler = function (socket) {
368
368
if ( ! message || message . ttl <= 0 || message . ttl > MSG_TTL || ! message . data ) { return 0 }
369
369
try {
370
370
message . data = JSON . parse ( message . data )
371
+ if ( socket . broadcast && socket . broadcast . emit ) {
372
+ socket . broadcast . emit ( 'broadcast' , message ) // 继续向发信人以外广播
373
+ }
371
374
} finally {
372
375
this . emit ( 'broadcast' , message . data )
373
376
if ( wo . EventBus ) wo . EventBus . crosEmit ( 'Peer' , 'broadcast' , message . data )
374
- socket . broadcast . emit ( 'broadcast' , message ) // 继续向发信人以外广播
375
377
}
376
378
} )
377
379
socket . on ( 'disconnect' , ( ) => {
You can’t perform that action at this time.
0 commit comments