|
@@ -512,7 +512,7 @@ implementation
|
|
|
|
|
|
uses
|
|
|
UConst, ULog, UNode, UTime, UPCEncryption, UChunk,
|
|
|
- UPCOperationsBlockValidator, UPCOperationsSignatureValidator,
|
|
|
+ UPCOperationsBlockValidator, UPCOperationsSignatureValidator, UOpTransaction,
|
|
|
UPCTemporalFileStream;
|
|
|
|
|
|
Const
|
|
@@ -3925,8 +3925,13 @@ var operationsComp : TPCOperationsComp;
|
|
|
If Not TAccountComp.EqualOperationBlocks(operationsComp.OperationBlock,original_OperationBlock) then begin
|
|
|
// This can happen when a OpReference in my MEMPOOL is different to an OpReference in the miner, causing different OperationsHash value
|
|
|
// This means a possible double spend found
|
|
|
- TLog.NewLog(lterror,ClassName,Format('Constructed a distinct FAST PROPAGATION block with my mempool operations. Received: %s Constructed: %s',
|
|
|
+ if Not operationsComp.OperationsHashTree.HasOpRecoverOperations then begin
|
|
|
+ TLog.NewLog(lterror,ClassName,Format('Constructed a distinct FAST PROPAGATION block with my mempool operations. Received: %s Constructed: %s',
|
|
|
[TPCOperationsComp.OperationBlockToText(original_OperationBlock),TPCOperationsComp.OperationBlockToText(operationsComp.OperationBlock)]));
|
|
|
+ end else begin
|
|
|
+ TLog.NewLog(ltdebug,ClassName,Format('Constructed a distinct FAST PROPAGATION block with my mempool operations. Received: %s Constructed: %s',
|
|
|
+ [TPCOperationsComp.OperationBlockToText(original_OperationBlock),TPCOperationsComp.OperationBlockToText(operationsComp.OperationBlock)]));
|
|
|
+ end;
|
|
|
if Not TPCSafeBox.IsValidOperationBlock(original_OperationBlock,errors) then begin
|
|
|
// This means a scammer!
|
|
|
DoDisconnect := True;
|
|
@@ -4637,8 +4642,12 @@ begin
|
|
|
data := TMemoryStream.Create;
|
|
|
try
|
|
|
request_id := TNetData.NetData.NewRequestId;
|
|
|
- // Will send a FAST PROPAGATION BLOCK as described at PIP-0015
|
|
|
- netOp := CT_NetOp_NewBlock_Fast_Propagation;
|
|
|
+ if (NewBlock.OperationsHashTree.HasOpRecoverOperations) then begin
|
|
|
+ netOp := CT_NetOp_NewBlock;
|
|
|
+ end else begin
|
|
|
+ // Will send a FAST PROPAGATION BLOCK as described at PIP-0015
|
|
|
+ netOp := CT_NetOp_NewBlock_Fast_Propagation;
|
|
|
+ end;
|
|
|
NewBlock.SaveBlockToStream(netOp = CT_NetOp_NewBlock_Fast_Propagation,data); // Will save all only if not FAST PROPAGATION
|
|
|
// Send Aggregated Hashsrate based on network protocol available version
|
|
|
if FNetProtocolVersion.protocol_available>=CT_MIN_NetProtocol_Use_Aggregated_Hashrate then begin
|
|
@@ -4658,6 +4667,9 @@ begin
|
|
|
data.Write(opRef,SizeOf(opRef));
|
|
|
end;
|
|
|
end;
|
|
|
+ TLog.NewLog(ltdebug,ClassName,Format('Sending NEW FAST PROPAGATION BLOCK %d with %d operations in %d bytes to %s',[NewBlock.OperationBlock.block,c,data.Size,ClientRemoteAddr]));
|
|
|
+ end else begin
|
|
|
+ TLog.NewLog(ltdebug,ClassName,Format('Sending NEW BLOCK %d with %d operations in %d bytes to %s',[NewBlock.OperationBlock.block,NewBlock.Count,data.Size,ClientRemoteAddr]));
|
|
|
end;
|
|
|
Send(ntp_autosend,netOp,0,request_id,data);
|
|
|
finally
|