Skip to content

Commit

Permalink
Fixed a bug where if the last block stored was an orphan, getLatestBl…
Browse files Browse the repository at this point in the history
…ockNode() would return 0.

This caused terminal duplicates in the database to be created.
  • Loading branch information
thallium205 committed Jun 6, 2012
1 parent ee68dd8 commit 34b2eca
Show file tree
Hide file tree
Showing 86 changed files with 9,723 additions and 79 deletions.
38 changes: 38 additions & 0 deletions client/app/controllers/addresses.js
@@ -0,0 +1,38 @@

var Addresses = function () {
this.respondsWith = ['html', 'json', 'xml', 'js', 'txt'];

this.index = function (req, resp, params) {
this.respond({params: params});
};

this.add = function (req, resp, params) {
this.respond({params: params});
};

this.create = function (req, resp, params) {
// Save the resource, then display index page
this.redirect({controller: this.name});
};

this.show = function (req, resp, params) {
this.respond({params: params});
};

this.edit = function (req, resp, params) {
this.respond({params: params});
};

this.update = function (req, resp, params) {
// Save the resource, then display the item page
this.redirect({controller: this.name, id: params.id});
};

this.remove = function (req, resp, params) {
this.respond({params: params});
};

};

exports.Addresses = Addresses;

40 changes: 40 additions & 0 deletions client/app/models/address.js
@@ -0,0 +1,40 @@

var Address = function () {
/*
this.property('login', 'string', {required: true});
this.property('password', 'string', {required: true});
this.property('lastName', 'string');
this.property('firstName', 'string');
this.validatesPresent('login');
this.validatesFormat('login', /[a-z]+/, {message: 'Subdivisions!'});
this.validatesLength('login', {min: 3});
// Use with the name of the other parameter to compare with
this.validatesConfirmed('password', 'confirmPassword');
// Use with any function that returns a Boolean
this.validatesWithFunction('password', function (s) {
return s.length > 0;
});
// Can define methods for instances like this
this.someMethod = function () {
// Do some stuff
};
*/

};

/*
// Can also define them on the prototype
Address.prototype.someOtherMethod = function () {
// Do some other stuff
};
// Can also define static methods and properties
Address.someStaticMethod = function () {
// Do some other stuff
};
Address.someStaticProperty = 'YYZ';
*/

Address = geddy.model.register('Address', Address);

8 changes: 8 additions & 0 deletions client/app/views/addresses/add.html.ejs
@@ -0,0 +1,8 @@
<div class="hero-unit">
<h3>Params</h3>
<ul>
<% for (var p in params) { %>
<li><%= p + ': ' + params[p]; %></li>
<% } %>
</ul>
</div>
8 changes: 8 additions & 0 deletions client/app/views/addresses/edit.html.ejs
@@ -0,0 +1,8 @@
<div class="hero-unit">
<h3>Params</h3>
<ul>
<% for (var p in params) { %>
<li><%= p + ': ' + params[p]; %></li>
<% } %>
</ul>
</div>
8 changes: 8 additions & 0 deletions client/app/views/addresses/index.html.ejs
@@ -0,0 +1,8 @@
<div class="hero-unit">
<h3>Params</h3>
<ul>
<% for (var p in params) { %>
<li><%= p + ': ' + params[p]; %></li>
<% } %>
</ul>
</div>
8 changes: 8 additions & 0 deletions client/app/views/addresses/show.html.ejs
@@ -0,0 +1,8 @@
<div class="hero-unit">
<h3>Params</h3>
<ul>
<% for (var p in params) { %>
<li><%= p + ': ' + params[p]; %></li>
<% } %>
</ul>
</div>
1 change: 1 addition & 0 deletions client/app/views/layouts/application.html.ejs
Expand Up @@ -15,6 +15,7 @@

<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/d3.v2.js"></script>

<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/style.css">
Expand Down
36 changes: 30 additions & 6 deletions client/app/views/main/index.html.ejs
@@ -1,6 +1,30 @@
<!-- Lets talk about geddy -->
<div class="hero-unit geddy-welcome-box">
<h1>Hello, World!</h1>
<p>You've created a Geddy app and your server is running. If you already know what you're doing, feel free to jump into your app logic, if not...</p>
<p><a href="http://geddyjs.org/tutorial.html" class="btn btn-primary btn-large">Lets get you started »</a></p>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span4">
<!--Sidebar content-->
<form class="well form-search">
<input type="text" class="input-medium search-query">
<button type="submit" class="btn">Search</button>
</form>
</div>
<div class="span8">
<!--Body content-->
<div id="viz"></div>
<script type="text/javascript">
var sampleSVG = d3.select("#viz")
.append("svg")
.attr("width", 100)
.attr("height", 100);
sampleSVG.append("circle")
.style("stroke", "gray")
.style("fill", "white")
.attr("r", 40)
.attr("cx", 50)
.attr("cy", 50)
.on("mouseover", function(){d3.select(this).style("fill", "aliceblue");})
.on("mouseout", function(){d3.select(this).style("fill", "white");});
</script>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions client/config/router.js
Expand Up @@ -32,5 +32,6 @@ router.match('/').to({controller: 'Main', action: 'index'});
// Resource-based routes
// router.resource('hemispheres');

router.resource('addresses');
exports.router = router;

113 changes: 96 additions & 17 deletions client/log/access.log

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/log/stderr.log
@@ -0,0 +1 @@
[Tue, 05 Jun 2012 05:23:23 GMT] ERROR adapter not found
16 changes: 8 additions & 8 deletions client/log/stdout.log
@@ -1,16 +1,16 @@
[Sat, 02 Jun 2012 04:51:34 GMT] INFO Server starting with config: {
[Tue, 05 Jun 2012 05:23:23 GMT] INFO Server starting with config: {
"environment": "development",
"workers": 1,
"port": 4000,
"debug": true,
"rotateWorkers": false,
"rotationWindow": 7200000,
"rotationTimeout": 300000,
"logDir": "E:\\Workspace\\BitcoinVisualizer\\src\\bitcoinvisualizer\\client\\log",
"logDir": "E:\\Workspace\\BitcoinVisualizer\\client\\log",
"gracefulShutdownTimeout": 30000,
"heartbeatInterval": 5000,
"heartbeatWindow": 20000,
"staticFilePath": "E:\\Workspace\\BitcoinVisualizer\\src\\bitcoinvisualizer\\client\\public",
"staticFilePath": "E:\\Workspace\\BitcoinVisualizer\\client\\public",
"sessions": {
"store": "memory",
"key": "sid",
Expand All @@ -21,7 +21,7 @@
"i18n": {
"defaultLocale": "en-us",
"loadPaths": [
"E:\\Workspace\\BitcoinVisualizer\\src\\bitcoinvisualizer\\client\\config\\locales"
"E:\\Workspace\\BitcoinVisualizer\\client\\config\\locales"
]
},
"ssl": null,
Expand All @@ -32,7 +32,7 @@
"detailedErrors": true,
"hostname": null
}
[Sat, 02 Jun 2012 04:51:34 GMT] INFO Creating 1 worker process.
[Sat, 02 Jun 2012 04:51:34 GMT] INFO Server worker running in development on port 4000 with a PID of: 4660
[Sat, 02 Jun 2012 04:51:34 GMT] DEBUG LOGGING STARTED ============================================
[Sat, 02 Jun 2012 04:51:34 GMT] DEBUG ============================================================
[Tue, 05 Jun 2012 05:23:23 GMT] INFO Creating 1 worker process.
[Tue, 05 Jun 2012 05:23:23 GMT] INFO Server worker running in development on port 4000 with a PID of: 992
[Tue, 05 Jun 2012 05:23:23 GMT] DEBUG LOGGING STARTED ============================================
[Tue, 05 Jun 2012 05:23:23 GMT] DEBUG ============================================================

0 comments on commit 34b2eca

Please sign in to comment.