Skip to content

Instantly share code, notes, and snippets.

@bitPico
Created June 27, 2018 03:43
Show Gist options
  • Save bitPico/904352bd356baff866093de57c8caa23 to your computer and use it in GitHub Desktop.
Save bitPico/904352bd356baff866093de57c8caa23 to your computer and use it in GitHub Desktop.
Bitcoin ABC Large Block ZeroDay Vulnerability - 01
static bool ConnectBlock(const Config &config, const CBlock &block,
CValidationState &state, CBlockIndex *pindex,
CCoinsViewCache &view, bool fJustCheck = false) {
==> AssertLockHeld(cs_main);
// ...
==> if (!control.Wait()) {
return state.DoS(100, false, REJECT_INVALID, "blk-bad-inputs", false,
"parallel script check failed");
}
bool SendMessages(const Config &config, CNode *pto, CConnman &connman,
const std::atomic<bool> &interruptMsgProc) {
// ....
==> TRY_LOCK(cs_main, lockMain);
if (!lockMain) {
return true;
}
@sesam
Copy link

sesam commented Jun 29, 2018

Multi threading 101: get & hold lock, do stuff, release lock. Seems that's not how Bcash understood this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment