diff options
author | fanquake <fanquake@gmail.com> | 2021-08-18 08:33:54 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-08-18 08:49:48 +0800 |
commit | 62cb4009c2acc3d72b8c71327553681295bef814 (patch) | |
tree | 31eb0a99276a75d345ef7dbe4ee047be135004d9 /src/node/interfaces.cpp | |
parent | fdd80b0a53b4af0b29cb6e03118e2456d053a757 (diff) | |
parent | 5c5d0b62648e1b144b7b93c199f45265dac100e5 (diff) | |
download | bitcoin-62cb4009c2acc3d72b8c71327553681295bef814.tar.xz |
Merge bitcoin/bitcoin#22215: refactor: Add FoundBlock.found member
5c5d0b62648e1b144b7b93c199f45265dac100e5 Add FoundBlock.found member (Russell Yanofsky)
Pull request description:
This change lets IPC serialization code handle FoundBlock arguments more simply and efficiently. Without this change there was no way to determine from a FoundBlock object whether a block was found or not. So in order to correctly implement behavior of leaving FoundBlock output variables unmodified when a block was not found, IPC code would have to read preexisting output variable values from the local process, send them to the remote process, receive output values back from the remote process, and save them to output variables unconditionally. With FoundBlock.found method, the process is simpler. There's no need to read or send preexisting local output variable values, just to read final output values from the remote process and set them conditionally if the block was found.
---
This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). The commit was first part of larger PR #10102.
ACKs for top commit:
fjahr:
Code review ACK 5c5d0b62648e1b144b7b93c199f45265dac100e5
theStack:
Concept and code review ACK 5c5d0b62648e1b144b7b93c199f45265dac100e5
jamesob:
ACK 5c5d0b62648e1b144b7b93c199f45265dac100e5 ([`jamesob/ackr/22215.1.ryanofsky.refactor_add_foundblock`](https://github.com/jamesob/bitcoin/tree/ackr/22215.1.ryanofsky.refactor_add_foundblock))
Zero-1729:
crACK 5c5d0b6
Tree-SHA512: d906e1b7100ff72c3aa06d80bd77673887b2db670ebd52dce7c4f6f557a23a1744c6109308228a37fda6c6ea74f05ba0efecff0ef235ab06ea8acd861fbb8675
Diffstat (limited to 'src/node/interfaces.cpp')
-rw-r--r-- | src/node/interfaces.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 183b5a5d91..eef4ce1c6c 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -334,6 +334,7 @@ bool FillBlock(const CBlockIndex* index, const FoundBlock& block, UniqueLock<Rec REVERSE_LOCK(lock); if (!ReadBlockFromDisk(*block.m_data, index, Params().GetConsensus())) block.m_data->SetNull(); } + block.found = true; return true; } |