Skip to content

Instantly share code, notes, and snippets.

View GeertJohan's full-sized avatar

Geert-Johan Riemer GeertJohan

View GitHub Profile
// Digi algorithm should never be used until at least 2 blocks are mined.
// Contains code by RealSolid & WDC
// Cleaned up for use in Guldencoin by GeertJohan (dead code removal since Guldencoin retargets every block)
unsigned int static GetNextWorkRequired_DIGI(const CBlockIndex* pindexLast, const CBlockHeader *pblock){
// retarget timespan is set to a single block spacing because there is a retarget every block
int64 retargetTimespan = nTargetSpacing;
// get previous block
const CBlockIndex* pindexPrev = pindexLast->pprev;
assert(pindexPrev);

Clean up Digishield for use in Guldencoin.

Removing unused local variable nHeight.

Both nTargetSpacing and nTargetTimespanNEW are defined as 2.5*60, which means that retargetInterval will always equal 1. This means that (pindexLast->nHeight+1) % retargetInterval will always resolve to 0 and therefore the block following if ((pindexLast->nHeight+1) % retargetInterval != 0) will never be ran. Removing the complete block as it is dead code.

Removing the genesis exception, we're never mining a genesis block with DIGI.

Removing the now unused local variables nProofOfWorkLimit and retargetSpacing.

package main
import (
"fmt"
"github.com/segmentio/go-loggly"
"gopkg.in/inconshreveable/log15.v2"
)
type LogglyHook struct {
package main
import (
"fmt"
"github.com/segmentio/go-loggly"
"gopkg.in/inconshreveable/log15.v2"
)
type LogglyHook struct {
FROM ubuntu
RUN apt-get update && apt-get install -y ktorrent
CMD /usr/bin/ktorrent
$ ls -al
total 172
drwxr-xr-x 2 geertjohan geertjohan 4096 Feb 24 16:23 .
drwx------ 52 geertjohan geertjohan 20480 Feb 24 16:25 ..
-rw-r--r-- 1 geertjohan geertjohan 4443 Feb 24 11:15 :100.log
-rw-r--r-- 1 geertjohan geertjohan 4443 Feb 24 11:14 :100.log.old
srw------- 1 geertjohan geertjohan 0 Feb 24 16:23 5b140a830a50-100
lrwxrwxrwx 1 geertjohan geertjohan 16 Feb 24 16:23 foizetux-100 -> 5b140a830a50-100
-rw-r--r-- 1 geertjohan geertjohan 98 Feb 24 11:28 foizetux-100.log
-rwx------ 1 geertjohan geertjohan 1009 Feb 24 16:23 run-xpra
@GeertJohan
GeertJohan / Dockerfile
Created February 24, 2015 15:34
explanation at the bottom
FROM ubuntu
RUN sudo apt-get update && sudo apt-get -y install xpra x11-apps
RUN export uid=1000 gid=1000 && \
mkdir -p /home/user && \
echo "user:x:${uid}:${gid}:User,,,:/home/user:/bin/bash" >> /etc/passwd && \
echo "user:x:${uid}:" >> /etc/group && \
chown ${uid}:${gid} -R /home/user
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
@GeertJohan
GeertJohan / newfile
Last active August 29, 2015 14:17
.zprezto/modules/prompt/functions/prompt_geertjohan_setup
#
# A three-line prompt displaying exit status, location, git info, and more.
#
# Authors:
# Geert-Johan Riemer <geertjohan@geertjohan.net>
#
# Load dependencies.
pmodload 'helper'
[www.kiwiirc.com] `bittrex-richie (1f94dba5@gateway/web/cgi-irc/kiwiirc.com/ip.31.148.219.165)
MaNl is connected via sinisalo.freenode.net (SE)
12:55 <MaNl> hey
12:55 <MaNl> GeertJohan
12:55 <GeertJohan> Hiya
12:56 <MaNl> how is going bro
12:56 <GeertJohan> Yeah, good :)
12:56 <GeertJohan> You?
12:56 <MaNl> we going to pump gulden , are u inside m group