jl777 8 years ago
parent
commit
ebdaac975a
  1. 19
      iguana/dpow/dpow_network.c
  2. 1
      iguana/dpow/dpow_tx.c

19
iguana/dpow/dpow_network.c

@ -192,15 +192,17 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct
bp->notaries[senderind].ratifydestvout = destvout; bp->notaries[senderind].ratifydestvout = destvout;
bp->notaries[senderind].ratifybestmask = bestmask; bp->notaries[senderind].ratifybestmask = bestmask;
bp->notaries[senderind].ratifyrecvmask = recvmask; bp->notaries[senderind].ratifyrecvmask = recvmask;
bp->notaries[senderind].ratifybestk = bestk; if ( (bp->notaries[senderind].ratifybestk= bestk) >= 0 )
for (i=0; i<2; i++)
{ {
if ( (bp->notaries[senderind].ratifysiglens[i]= siglens[i]) != 0 ) for (i=0; i<2; i++)
{ {
memcpy(bp->notaries[senderind].ratifysigs[i],sigs[i],siglens[i]); if ( (bp->notaries[senderind].ratifysiglens[i]= siglens[i]) != 0 )
if ( bestk == bp->pendingbestk && bestmask == bp->pendingbestmask ) {
bp->ratifysigmasks[i] |= (1LL << senderind); memcpy(bp->notaries[senderind].ratifysigs[i],sigs[i],siglens[i]);
else bp->ratifysigmasks[i] &= ~(1LL << senderind); if ( bestk == bp->pendingbestk && bestmask == bp->pendingbestmask )
bp->ratifysigmasks[i] |= (1LL << senderind);
else bp->ratifysigmasks[i] &= ~(1LL << senderind);
}
} }
} }
bp->ratifyrecvmask |= (1LL << senderind) | (1LL << bp->myind); bp->ratifyrecvmask |= (1LL << senderind) | (1LL << bp->myind);
@ -210,9 +212,6 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct
bp->notaries[bp->myind].ratifyrecvmask = bp->ratifyrecvmask; bp->notaries[bp->myind].ratifyrecvmask = bp->ratifyrecvmask;
if ( bp->ratifybestk >= 0 ) if ( bp->ratifybestk >= 0 )
{ {
bp->notaries[bp->myind].ratifybestmask = bp->ratifybestmask;
bp->notaries[bp->myind].ratifyrecvmask = bp->ratifyrecvmask;
bp->notaries[bp->myind].ratifybestk = bp->ratifybestk;
for (i=0; i<bp->numnotaries; i++) for (i=0; i<bp->numnotaries; i++)
{ {
if ( bp->ratifybestk >= 0 && bp->notaries[i].ratifybestk == bp->ratifybestk && bp->notaries[i].ratifybestmask == bp->ratifybestmask ) if ( bp->ratifybestk >= 0 && bp->notaries[i].ratifybestk == bp->ratifybestk && bp->notaries[i].ratifybestmask == bp->ratifybestmask )

1
iguana/dpow/dpow_tx.c

@ -443,6 +443,7 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc
{ {
bp->ratifysiglens[src_or_dest] = (int32_t)strlen(sigstr) >> 1; bp->ratifysiglens[src_or_dest] = (int32_t)strlen(sigstr) >> 1;
decode_hex(bp->ratifysigs[src_or_dest],bp->ratifysiglens[src_or_dest],sigstr); decode_hex(bp->ratifysigs[src_or_dest],bp->ratifysiglens[src_or_dest],sigstr);
bp->ratifysigmasks[src_or_dest] |= (1LL << bp->myind);
} }
} }
} }

Loading…
Cancel
Save