(block_height == 0)
"ledger.db" is broken
Thanks, never seen this issue before, what version are you running?
Do you have a log entry for that, please? And a copy of your blockchain if possible
I would love to know if you received it from my node, but it must be since there are no other nodes
I am still patiently waiting for someone to do the rollback hack before I fix it
from My TestCode
import sqlite3
import socket
import time
import base64
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA
# import keys
key = RSA.importKey(open('privkey.der').read())
public_key = key.publickey()
private_key_readable = str(key.exportKey())
public_key_readable = str(key.publickey().exportKey())
address = hashlib.sha224(public_key_readable).hexdigest()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#s.settimeout(1)
s.connect(("0.0.0.0", int("2829")))
print "Connected"
#enter transaction start
conn = sqlite3.connect('ledger.db')
c = conn.cursor()
apiKey = 'blockfound_'
makeTimeStamp = 2.00
makeFromAddress = 'genesis'
makeToAddress = '07fb3a0e702f0eec167f1fd7ad094dcb8bdd398c91999d59e4dcb475'
makeAmount = 1.1
makefee = 1.0
reward = 0
transaction = str(makeTimeStamp) + ":" + str(makeFromAddress) +":" + str(makeToAddress) +":"+ str(makeAmount)
h = SHA.new(transaction)
signer = PKCS1_v1_5.new(key)
signature = signer.sign(h)
signature_enc = base64.b64encode(signature)
print "Client: Encoded Signature: "+str(signature_enc)
txhash_new = hashlib.sha224(str(transaction) + str(signature_enc) + str('BangC')).hexdigest()
c.execute("INSERT INTO transactions VALUES ('" + str(0) + "','" + str(
makeTimeStamp) + "','" + str(makeFromAddress) + "','" + str(makeToAddress) + "','" + str(
float(makeAmount)) + "','" + str(signature_enc) + "','" + str(
public_key_readable) + "','" + str(txhash_new) + "','" + str(makefee) + "','" + str(
reward) + "')")
c.execute("SELECT * FROM transactions WHERE block_height='" + str(
0) + "'")
txhash_send = c.fetchone()
c.execute("delete FROM transactions WHERE block_height ='" + str(0) + "'")
conn.commit()
conn.close()
s.sendall(apiKey)
time.sleep(0.1)
txhash_len = len(str(txhash_send))
while len(str(txhash_len)) != 10:
txhash_len = "0" + str(txhash_len)
s.sendall(str(txhash_len))
time.sleep(0.1)
s.sendall(str(txhash_send))