]> Cypherpunks.ru repositories - nncp.git/commitdiff
Delete downloaded file state
authorSergey Matveev <stargrave@stargrave.org>
Mon, 16 Jan 2017 21:12:18 +0000 (00:12 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 16 Jan 2017 21:12:18 +0000 (00:12 +0300)
src/cypherpunks.ru/nncp/sp.go

index 085d96f3f422c5e55343f1a41d55d7363457cc32..9a46961aad78c6494f28208f228d0a8b7fbe9e5b 100644 (file)
@@ -851,6 +851,9 @@ func (state *SPState) ProcessSP(payload []byte) ([][]byte, error) {
                                }
                                state.ctx.LogI("sp-done", SdsAdd(sdsp, SDS{"xx": string(TRx)}), "")
                                os.Rename(filePath+PartSuffix, filePath)
+                               state.Lock()
+                               delete(state.infosTheir, *file.Hash)
+                               state.Unlock()
                                go func() {
                                        state.payloads <- MarshalSP(SPTypeDone, SPDone{file.Hash})
                                }()