connector
This commit is contained in:
parent
5e262b8e95
commit
067ae2da8f
@ -255,7 +255,6 @@ static PyObject *LRU_delete(LRU *self, PyObject *args)
|
|||||||
if (!PyArg_ParseTuple(args, "O|O", &key, &instead)) return NULL;
|
if (!PyArg_ParseTuple(args, "O|O", &key, &instead)) return NULL;
|
||||||
|
|
||||||
Node *node = GET_NODE(self->dict, key);
|
Node *node = GET_NODE(self->dict, key);
|
||||||
PyErr_Clear(); /* GET_NODE sets an exception on miss. Shut it up. */
|
|
||||||
if (!node) {
|
if (!node) {
|
||||||
if (!instead) { Py_RETURN_NONE; }
|
if (!instead) { Py_RETURN_NONE; }
|
||||||
Py_INCREF(instead);
|
Py_INCREF(instead);
|
||||||
|
|||||||
@ -245,7 +245,7 @@ class Worker:
|
|||||||
inp = block["rawTx"][z]["vIn"][i]
|
inp = block["rawTx"][z]["vIn"][i]
|
||||||
outpoint = b"".join((inp["txId"], int_to_bytes(inp["vOut"])))
|
outpoint = b"".join((inp["txId"], int_to_bytes(inp["vOut"])))
|
||||||
try:
|
try:
|
||||||
r = self.coins[outpoint]
|
r = self.coins.delete(outpoint)
|
||||||
block["rawTx"][z]["vIn"][i]["_c_"] = r
|
block["rawTx"][z]["vIn"][i]["_c_"] = r
|
||||||
t += 1
|
t += 1
|
||||||
self.destroyed_coins[r[0]] = True
|
self.destroyed_coins[r[0]] = True
|
||||||
@ -268,7 +268,7 @@ class Worker:
|
|||||||
for i in blocks[x]["rawTx"][y]["vOut"]:
|
for i in blocks[x]["rawTx"][y]["vOut"]:
|
||||||
try:
|
try:
|
||||||
pointer = (x << 42) + (y << 21) + i
|
pointer = (x << 42) + (y << 21) + i
|
||||||
blocks[x]["rawTx"][y]["vOut"][i]["_s_"] = self.destroyed_coins[pointer]
|
blocks[x]["rawTx"][y]["vOut"][i]["_s_"] = self.destroyed_coins.delete(pointer)
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
blocks[x] = pickle.dumps(blocks[x])
|
blocks[x] = pickle.dumps(blocks[x])
|
||||||
|
|||||||
@ -69,7 +69,7 @@ class UTXO():
|
|||||||
if lb != i[1][0] >> 42:
|
if lb != i[1][0] >> 42:
|
||||||
block_changed = True
|
block_changed = True
|
||||||
lb = i[1][0] >> 42
|
lb = i[1][0] >> 42
|
||||||
if self.cached <= self.size_limit:
|
if len(self.cached) <= self.size_limit:
|
||||||
if block_changed:
|
if block_changed:
|
||||||
break
|
break
|
||||||
utxo.add((i[0],b"".join((int_to_c_int(i[1][0]),
|
utxo.add((i[0],b"".join((int_to_c_int(i[1][0]),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user