Page MenuHomePhabricator

Record when block was fully received
ClosedPublic

Authored by schancel on Sat, Nov 24, 21:06.

Details

Summary

As per title. This potentially enables punishment for block withholding
as per Jonathan Toomim's ideas.

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

schancel created this revision.Sat, Nov 24, 21:06
Herald added a reviewer: Restricted Project. · View Herald TranscriptSat, Nov 24, 21:06
jasonbcox requested changes to this revision.Sat, Nov 24, 23:57
jasonbcox added a subscriber: jasonbcox.

This diff never sets the block received time as described in the summary.

src/chain.h
100 ↗(On Diff #6079)

Block and header times should be in alphabetical order (swap them)

124 ↗(On Diff #6079)

Swap here too

143 ↗(On Diff #6079)

Swap here too

src/validation.cpp
3726 ↗(On Diff #6079)

This overwrites the header received time, which doesn't seem like the expected behavior at all.

This revision now requires changes to proceed.Sat, Nov 24, 23:57
schancel marked 2 inline comments as done.Sun, Nov 25, 00:17
schancel added inline comments.
src/chain.h
124 ↗(On Diff #6079)

Says who? None of the rest of this stuff is in alphabetical order.

src/validation.cpp
3726 ↗(On Diff #6079)

You are correct sir. Not sure wtf I was doing.

schancel updated this revision to Diff 6082.Sun, Nov 25, 00:22

Correctly test BlockReceived time

schancel updated this revision to Diff 6083.Sun, Nov 25, 00:42

Update ordering of variables

schancel updated this revision to Diff 6084.Sun, Nov 25, 00:43

Update ordering in one more place

jasonbcox accepted this revision.Mon, Nov 26, 18:56
This revision is now accepted and ready to land.Mon, Nov 26, 18:56
This revision was automatically updated to reflect the committed changes.