0
I have to compose a "getblocks" command found in https://en.bitcoin.it/wiki/Protocol_specification#getblocks
The "getblocks" command contains the "block locator hashes". In essence, I inform a remote node of block hashes that I'm aware of already. There is a rule of how to construct the block locator. Except I’ve no idea of what “pushing”, “going back” or “newest back” means. I cannot figure out the order of block hashes in what I call a locatorArray.
Let’s assume I want to advertise three block hashes:
- Block hash of block number zero.
- Block hash of block number one.
- Block hash of block number two.
Let’s assume I have an array of three elements. For example, I might walk through the array in a for loop as follows:
for ( int i = 0; i < locatorArrayLength; i++ )
{
}
The block hash of which block number should be in locatorArray[0]?
The block hash of which block number should be in locatorArray[2]?
Where did this data come from, the daemon, an API? Some context would be helpful. – morsecoder – 2014-10-31T17:07:22.683
I don't understand what data you want in locatorArray. – Nick ODell – 2014-10-31T17:12:46.893
I've made the statement of my problem more lucid. – u2843 – 2014-10-31T17:43:51.723
@u2843 Did you read the snippet of code provided alongside the documentation? – Nick ODell – 2014-10-31T17:54:30.947
@Nick ODell I didn't read it. I looked at it. I don't know the language it's written in. I've no idea of what's going on in there. I don't need to know the mechanics of the code. All I care about is whether, using my example, the block number zero is in locatorArray[0] and block number two is in locatorArray[2], or block number two is in locatorArray[0] and block number zero is in locatorArray[2]. – u2843 – 2014-10-31T18:13:41.603