-
Notifications
You must be signed in to change notification settings - Fork 9
Comparing changes
Open a pull request
base repository: rustyrussell/pettycoin
base: cbfe0cac566e^
head repository: rustyrussell/pettycoin
compare: 95c00a253188
- 20 commits
- 69 files changed
- 1 contributor
Commits on Sep 15, 2014
-
recv_block: log block height when we get error.
Usually it's UNKNOWN_PREV (ie. we're syncing); it's good to know what block we're up to. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for cbfe0ca - Browse repository at this point
Copy the full SHA cbfe0caView commit details -
peer: remove erroneous peers from the cache.
We kept reconnecting to a peer when a bug caused a bad welcome. Rename close_peer to close_bad_peer to make it really clear. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 59114ca - Browse repository at this point
Copy the full SHA 59114caView commit details -
peer: change peer port when they give is a listen port.
This way we match the cache; the actual port they connected from is in the log prefix already. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for df2b2dc - Browse repository at this point
Copy the full SHA df2b2dcView commit details -
protocol: fix endian annotation on listen_port.
We treat it as le16 everywhere, the definition is wrong. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 2b0d537 - Browse repository at this point
Copy the full SHA 2b0d537View commit details -
difficulty: more helper functions.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 4fb3d3e - Browse repository at this point
Copy the full SHA 4fb3d3eView commit details -
protocol: add multiple previous block hashes to block hash (BREAKS PR…
…OTOCOL) Include the hashes of multiple previous blocks, not just the height-1 block. The idea of such a structure (sometimes called an SPV skipchain) came from bitcoin discussions, but it's particularly powerful for coins with a horizon like pettycoin. It allows discarding of some most blocks while maintaining proof that work was done. With a 10 second block time, we generate 3,153,600 blocks a year: 3.2GB with 1k blocks. Using the skipchain we can weed this down by a factor of 10 (more if we're lucky, a bit less if we're unlucky). I came across this idea in Mark Friedenbach's post on Compact SPV proofs: http://sourceforge.net/p/bitcoin/mailman/message/32111357/ But he traces the original idea to Andrew Miller's "The High-Value-Hash Highway": https://bitcointalk.org/index.php?topic=98986.0 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 3888f64 - Browse repository at this point
Copy the full SHA 3888f64View commit details -
protocol: check prev field on new blocks.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 81e87a1 - Browse repository at this point
Copy the full SHA 81e87a1View commit details -
protocol: fixed 8k interest bitmap (BREAKS PROTOCOL)
Might as well spell it out; it's only 8k. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for d0b20ca - Browse repository at this point
Copy the full SHA d0b20caView commit details -
Move detached block handing into its own file.
We'll want this for syncing, too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for ba1a944 - Browse repository at this point
Copy the full SHA ba1a944View commit details -
recv_block: handle blocks which aren't inside protocol_pkt_block.
We're going to change protocol_pkt_welcome to include a marshaled block, but all the code assumes a protocol_pkt_block. Remove this assumption, though we still need to pass in the tal'ed ptr, so we can steal it. This lets us fix a wart in the submitblock JSON API, too: it doesn't need the protocol_pkt_block header any more. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 14fe8bb - Browse repository at this point
Copy the full SHA 14fe8bbView commit details -
Helper to calculate how many (non-zero) previous hashes we have. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 57e47bc - Browse repository at this point
Copy the full SHA 57e47bcView commit details -
protocol: Make welcome include "best" block (BREAKS PROTOCOL)
This approach is inspired by Gregory Maxwell's Reverse_header-fetching_sync: https://en.bitcoin.it/wiki/User:Gmaxwell/Reverse_header-fetching_sync It's made more powerful by the presence of multiple previous block pointers, so we can get much more parallelism. We don't currently compare results across different peers, so we could be lead down the garden path by some peer. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 93af978 - Browse repository at this point
Copy the full SHA 93af978View commit details -
pending: Remove incorrect comment, document weird behaviour.
I noticed that after a json sendrawtransaction injection, the node was doing a PROTOCOL_PKT_GET_TX for transactions it already had. This is because add_pending_tx() returns ECODE_INPUT_UNKNOWN as it doesn't look in the pending queue for inputs. It's a wart, but it's not a fatal flaw. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for fc3c883 - Browse repository at this point
Copy the full SHA fc3c883View commit details -
recv_block: get as many ancestors as we can at once.
This has the advantage that the queries can spread across multiple peers. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for c34b4d2 - Browse repository at this point
Copy the full SHA c34b4d2View commit details -
protocol: hash children for syncing (BREAKS PROTOCOL)
This makes sure we've got the correct tree, rather than just using a counter. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for f5912be - Browse repository at this point
Copy the full SHA f5912beView commit details -
recv_block: calculate minimum possible difficulty.
Using 1/16 of last block's difficulty is wrong for very old blocks: get more sophisticated by calculating minimum based on what we do know. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for ba2623f - Browse repository at this point
Copy the full SHA ba2623fView commit details -
protocol: fix fee calculation (BREAKS PROTOCOL)
We should charge 0.3% of the actual transferred amount (ie. not including change). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 98e98b0 - Browse repository at this point
Copy the full SHA 98e98b0View commit details -
pettycoin-generate: don't need timestamp.o
Use ccan/time directly, too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 26616e5 - Browse repository at this point
Copy the full SHA 26616e5View commit details -
Simple renaming: it really is the number of transactions within each shard, so num_txs[] is clearer. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 070f983 - Browse repository at this point
Copy the full SHA 070f983View commit details -
block_info: structure to contain block on the wire.
Since we're going to change it for merge mining, encapsulate it now to avoid massive refactor confusing the block structure. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 95c00a2 - Browse repository at this point
Copy the full SHA 95c00a2View commit details
There are no files selected for viewing