Commit graph

6 commits

Author SHA1 Message Date
Jimmy Kiselak
6f9808faff add an rpc command for getting the value of a name 2015-02-10 18:44:14 -05:00
Jimmy Kiselak
e7654b8703 add best block hash to ncc trie, and remove possibility of a null base to ncc cache
ensure the ncc trie and any caches are always in sync with the current best block
by informing the trie when the block changes, and have the ncc trie persist that
in the database. check against that whenever modifying the trie.

get rid of the possibility of a CNCCTrieCache having a null base, and create a
CNCCTrie in test_bitcoin.cpp so one exists during testing.
2015-02-10 15:30:40 -05:00
Jimmy Kiselak
389a2a963e fix a few bugs and add some assertions
ncctrietests.cpp:
add test to make sure emptying the ncc trie cache results in a
default hash ("00...01")
ncctrie.cpp:
fix the ncc trie cache so that emptying it causes the root hash
to be computed as the default hash ("00...01")
fix two bugs in reading the ncc trie from disk:
all insertions were returning immediately due to parenthesis
misplacement, and the loop reading nodes from disk wasn't
terminating due to a lack of an incrementing operation
miner.cpp
fix a bug in the miner where input coins in the cache were being
spent before their txouts could be checked for NCC commands
main.cpp
add some assertions when disconnecting blocks from the active
chain, ensuring the merkle root of the ncc trie after undoing the
block is equal to the hashNCCTrie in the previous block
fix an erroneous assertion in ConnectBlock to assert the correct
expected value
change some log statements to use __func__
init.cpp
change the order of some init operations so the NCC trie is
restored from disk before the DB is verified
2015-02-10 11:19:41 -05:00
Jimmy Kiselak
79be562ff2 rpc commands for browsing ncc trie, fix bugs caused by adding ncc merkle to header
create an rpc command to print the whole ncc trie
create an rpc command to search get transaction info
for a particular name
change the number of bytes in the header expected by miner.cpp
make sure the ncc merkle hash is copied to all structures that
need it
2015-02-07 12:32:05 -05:00
Jimmy Kiselak
b2b0bd5bb5 implement reading and writing the NCC trie to disk, create the global trie upon initialization, add and remove NCC claims when connecting and disconnecting blocks, and check block headers against the NCC merkle hash 2015-02-05 14:24:09 -05:00
Jimmy Kiselak
9bb4ecef2a move everything trie related into its own file, enable serialization of trie nodes and values, and create some tests for serialization 2015-02-02 20:57:53 -05:00