<feed xmlns='http://www.w3.org/2005/Atom'>
<title>npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/src/db.h, branch main</title>
<subtitle>[no description]</subtitle>
<id>https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/atom?h=main</id>
<link rel='self' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/'/>
<updated>2026-09-01T17:14:12+00:00</updated>
<entry>
<title>Merge upstream v1.2.20 into the  fork</title>
<updated>2026-09-01T17:14:12+00:00</updated>
<author>
<name>bitflash-maintainer</name>
<email>noreply@bitflash.invalid</email>
</author>
<published>2026-09-01T17:14:12+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=b4f0bc693ef7175702f82bcb2110b627922e8cbd'/>
<id>urn:sha1:b4f0bc693ef7175702f82bcb2110b627922e8cbd</id>
<content type='text'>
Merges upstream tag v1.2.20 (6aa3dade) into our 1.2.19+sec tree. The merge
base is bc3de30's descendant 9e39a50 -- upstream's own v1.2.19 -- so this is
an ordinary three-way merge, not a replay. Five conflict blocks in four
files, all resolved below.

No consensus change. CheckBlock, ConnectBlock, DisconnectBlock, ConnectInputs,
AcceptBlock, AcceptTransaction, GetNextWorkRequired and GetBlockValue hash
identical to v1.2.19; script.cpp and script.h are byte-identical on both
sides. main.cpp is +3 lines and main.h +2, all wallet-backend plumbing.
rpc.cpp is untouched, so the payout ledger arrives unchanged.

Makefile, VERSION. OURS, renumbered. 1.2.20+sec, for the same reason 1.2.19
carried +sec: this tree is not the upstream release of that number and the
string names every release artifact.

Makefile, AppImage recipe. OURS for the AppDir path, THEIRS for the bundled
library. Upstream's hunk reverts the icon paths to a hardcoded
/tmp/bitflash.AppDir, which is the local-user pre-placement hazard the fork
moved out of /tmp in the first place; taking their side wholesale would have
reintroduced it silently, inside a conflict about something else. The AppDir
stays $(APPDIR), and libsqlite3.so.0 joins the bundled list, which the new
backend genuinely needs.

src/Makefile, src/makefile.mingw, HEADERS. BOTH. Ours drops market.h,
theirs adds wallet_sqlite.h; the resolution does both. NODE_OBJS auto-merged
correctly in both files -- obj/wallet_sqlite.o present, obj/market.o still
gone -- and was verified rather than assumed, because that line has trapped
this fork before.

src/selftest.cpp, known-tests list. BOTH, union. Upstream adds eight
wallet-storage tests, we keep payout-ledger. The dispatch chain itself
auto-merged and still routes payout-ledger to RunPayoutLedgerSelfTest.

Hardening verified intact after merge: the TLS 1.2 floor in nostr.cpp, the
/rvrelay pin, opt-in managed Tor, strict sig3-on-onion descriptor
verification, and the marketplace removal. Upstream shipped no build logs or
__pycache__ this time; the three added files are docs/storage.md and
src/wallet_sqlite.{cpp,h}.

The SQLite backend this release introduces is NOT enabled here. An existing
wallet.dat resolves to Berkeley DB on every branch of the new selection
logic, and the conversion wizard is GUI-only and not compiled into the
headless node. The review findings that gate ever turning it on -- the
non-atomic backend marker, the connection-wide WriteHDMaster transaction,
and the encrypt-swap crash window -- are recorded on the tracker, not fixed
here.
</content>
</entry>
<entry>
<title>net: stop serving the 2009 marketplace to anonymous peers</title>
<updated>2026-08-23T04:37:36+00:00</updated>
<author>
<name>bitflash-maintainer</name>
<email>noreply@bitflash.invalid</email>
</author>
<published>2026-08-19T18:17:06+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=a7744058c49b1ba2c605f9e8380d9c3e8665bbc0'/>
<id>urn:sha1:a7744058c49b1ba2c605f9e8380d9c3e8665bbc0</id>
<content type='text'>
Four inherited handlers took attacker-controlled input and wrote to disk
with nothing authorising it. None of them had a caller left anywhere in
the tree, so all four were reachable only from the outside.

checkorder called GenerateNewKey() -- AddKey(), a wallet.dat write -- for
any peer that asked, and handed back the pubkey. Its comment claims the
cache keeps one key per ip, and on a 2009 network of routable addresses
it did. Not here: inbound peers arrive through a rendezvous tunnel and
are tagged by BtfMarkerAddr() over three random bytes, so addr.ip is
fresh every connection and the cache never hits. Reconnect in a loop and
the node mints a key per connection, none of them in any backup taken
beforehand, which for a pre-BIP32 wallet is how coins go missing. The map
holding them was static and never trimmed.

submitorder AddToWallet()'d a CWalletTx from any peer that sent one. It
had to be a valid transaction; it did not have to be ours.

review checked a signature the sender made with its own key, which proves
possession and authorises nothing, then appended to reviews.dat by
reading the whole vector, pushing one entry and writing it all back --
quadratic disk on an unbounded map&lt;string,string&gt; off the socket -- then
walked a link graph the same peer supplied and relayed the message to
every other node.

reply dispatched into CRequestTracker. Nothing ever called PushRequest,
so the table was permanently empty and the handler was a parser and
nothing else.

Removed with the subsystem behind them: market.cpp, CProduct, CReview,
CUser, CReviewDB, the advert publish templates and the subscribe channel
machinery, none of which had an inbound handler either. MSG_REVIEW,
MSG_PRODUCT and MSG_TABLE stay in the inv enum, unserved: CInv puts type
on the wire as an integer and MSG_TX and MSG_BLOCK are shared with every
other node.

Unknown commands are already ignored for extensibility, so peers still
running these lose nothing but an answer they never asked for. Verified
by a clean build of bitflash-node.

(cherry picked from commit ad9c393866c007a115f32d70a9017ce91066a7d1)
</content>
</entry>
<entry>
<title>wallet: make SQLite the default backend for new wallets</title>
<updated>2026-08-18T19:14:19+00:00</updated>
<author>
<name>bitflash</name>
<email>dev@bitflash.network</email>
</author>
<published>2026-08-18T19:14:19+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=3f94ec0649f935d00de49ad7b55026317dc64a27'/>
<id>urn:sha1:3f94ec0649f935d00de49ad7b55026317dc64a27</id>
<content type='text'>
A fresh install with no wallet.dat now starts on the SQLite backend and
creates wallet.sqlite, instead of a Berkeley DB wallet.dat. The choice is
recorded in a plain-text &lt;datadir&gt;/wallet-backend marker so it survives a
restart without a command-line flag.

Backend resolution when no -walletbackend is given: an existing
wallet.sqlite (or a "sqlite" marker) stays on SQLite; an existing
wallet.dat stays on Berkeley DB -- nothing is converted behind the user;
a fresh datadir starts on SQLite. An explicit -walletbackend=bdb or a
"bdb" marker forces Berkeley DB and overrides the default.

Adds CreateNewSQLiteWallet() (WalletSQLiteRuntimeOpen gains fMustExist so
the create path can make a new file) which mints the first default key
straight into the SQLite store via the same FinishLoadedWallet() call the
Berkeley DB create path uses, then cleans up on failure. Marker read/write
helpers are plain text, hand-editable.

New wallet-backend-default self-test proves the resolution in child
processes (fresh-&gt;SQLite+marker, existing wallet.dat-&gt;BDB, "bdb"
marker-&gt;BDB, explicit flag-&gt;wallet.dat). The three wallet.dat-specific
suites now ask for -walletbackend=bdb explicitly, since a flagless fresh
datadir is SQLite now. All wallet suites pass.
</content>
</entry>
<entry>
<title>wallet: one-shot storage commands honour -walletbackend=sqlite</title>
<updated>2026-08-18T17:44:11+00:00</updated>
<author>
<name>bitflash</name>
<email>dev@bitflash.network</email>
</author>
<published>2026-08-18T17:44:11+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=84a60275569dca5d1fb12db38ce184caf7487ed6'/>
<id>urn:sha1:84a60275569dca5d1fb12db38ce184caf7487ed6</id>
<content type='text'>
-walletstorageaudit, -walletstoragecheck and -backupwallet all read
wallet.dat regardless of the selected backend. Under -walletbackend=sqlite
that is wrong, and for backup it is dangerous: it silently backs up the
stale plaintext wallet.dat instead of the live wallet.sqlite.

- ScanWalletRecords() routes to the active SQLite store instead of a
  Berkeley DB cursor (it returned an error under the runtime before). This
  is the single choke point audit and check scan through.
- WalletSQLiteRuntimeOpenReadOnly() opens wallet.sqlite for scanning
  without loading or validating records, so the pre-load diagnostics can
  inspect a wallet the loader would refuse. main_gui opens it for
  audit/check when the SQLite backend is selected (and rejects an unknown
  backend value there too).
- BackupWallet() copies wallet.sqlite (checkpoint, then the temp/old/rename
  dance; a checkpointed SQLite file is self-contained, no lsn_reset).

wallet-sqlite-encrypt self-test proves routing on a datadir where the
SQLite wallet is encrypted and wallet.dat beside it is still plaintext:
audit with the flag reports the encrypted seed, without it reports the
plaintext one; the SQLite backup carries no plaintext key and loadchecks
as a standalone wallet.
</content>
</entry>
<entry>
<title>wallet: bracket WriteHDMaster in a SQLite runtime transaction</title>
<updated>2026-08-18T17:33:40+00:00</updated>
<author>
<name>bitflash</name>
<email>dev@bitflash.network</email>
</author>
<published>2026-08-18T17:33:40+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=440d7f393d74f309d29e1d10ba1f11c41c869226'/>
<id>urn:sha1:440d7f393d74f309d29e1d10ba1f11c41c869226</id>
<content type='text'>
The SQLite runtime wrote each record as its own autocommit, so a group
that must land together -- hdmaster and hdchaincode, the two halves of an
HD seed -- could be left half-written by a failure or crash between them,
the incomplete-seed state -walletstoragecheck exists to catch. Berkeley DB
was no worse (it is not transactional here either) but no better.

Add WalletSQLiteRuntimeBeginTxn/CommitTxn/RollbackTxn -- no-ops that
succeed when the SQLite backend is not active, so Berkeley DB keeps its
existing per-write behaviour -- and wrap WriteHDMaster in them so the seed
lands all-or-nothing under SQLite. The one BDB-atomic wallet rewrite, the
encrypt path, is already matched by its own transaction in the SQLite
encrypt branch; every other wallet multi-write is ordering-based on both
backends by design.

wallet-sqlite self-test now proves the bracket: a rolled-back runtime
write leaves no record, a committed one persists, and WriteHDMaster lands
both halves of the seed.
</content>
</entry>
<entry>
<title>wallet: run the node on a SQLite backend (opt-in)</title>
<updated>2026-08-17T20:45:01+00:00</updated>
<author>
<name>bitflash</name>
<email>admin@bitflash.network</email>
</author>
<published>2026-08-17T20:45:01+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=2a2b9d74f8fb6b5d86d750e6e5d18c942738f95c'/>
<id>urn:sha1:2a2b9d74f8fb6b5d86d750e6e5d18c942738f95c</id>
<content type='text'>
Adds -walletbackend=sqlite: an opt-in flag that runs the node on
&lt;datadir&gt;/wallet.sqlite instead of wallet.dat. It requires an export to
exist first (no silent migration) and prints a step-by-step guide when
one does not; wallet.dat is never opened or touched, so a plain restart
goes back to Berkeley DB.

- LoadWalletFromSQLiteRuntime opens the export read-write, keeps the
  handle open as the active backend, loads records into memory through
  the same visitor/reconcile/finish path as the read-only staging load,
  and never fabricates a default key.
- Shutdown checkpoints and closes the SQLite backend; a kill before that
  loses nothing because WAL + synchronous=FULL already made every
  committed write durable.
- Self-test proves runtime writes persist across a close and reopen.

BDB stays the default: nothing activates the SQLite runtime unless the
flag is given. One-shot audit/recovery commands still use Berkeley DB.
</content>
</entry>
<entry>
<title>wallet: route CWalletDB through SQLite runtime</title>
<updated>2026-08-17T14:32:45+00:00</updated>
<author>
<name>Nsable-sh</name>
<email>nsable-sh@noreply.git.bitflash.network</email>
</author>
<published>2026-08-17T14:32:45+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=d082210c5d080c0a91412b94a109d8e73422eb31'/>
<id>urn:sha1:d082210c5d080c0a91412b94a109d8e73422eb31</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wallet: stage SQLite runtime loading</title>
<updated>2026-08-14T21:17:23+00:00</updated>
<author>
<name>Nsable-sh</name>
<email>nsable-sh@noreply.git.bitflash.network</email>
</author>
<published>2026-08-14T21:17:23+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=f9ee957bd6d3f28dfee166a82f389aad666a0119'/>
<id>urn:sha1:f9ee957bd6d3f28dfee166a82f389aad666a0119</id>
<content type='text'>
</content>
</entry>
<entry>
<title>db: recreate Berkeley DB environment after shutdown</title>
<updated>2026-08-14T16:06:57+00:00</updated>
<author>
<name>Nsable-sh</name>
<email>nsable-sh@noreply.git.bitflash.network</email>
</author>
<published>2026-08-14T15:59:03+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=82c3e10da01260650ddd2944e3f895ccf2c07ffc'/>
<id>urn:sha1:82c3e10da01260650ddd2944e3f895ccf2c07ffc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wallet: add read-only record scan boundary</title>
<updated>2026-08-14T12:08:29+00:00</updated>
<author>
<name>Nsable-sh</name>
<email>nsable-sh@noreply.git.bitflash.network</email>
</author>
<published>2026-08-14T12:08:29+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1q9geyrch3feyczz242sxjaa05yczv50dlpug082sjln2kl0wrnxst0nrfa/bitflash/commit/?id=95bd9cbcb1d17f4bc6223e6bfe3a92bfb8c3067d'/>
<id>urn:sha1:95bd9cbcb1d17f4bc6223e6bfe3a92bfb8c3067d</id>
<content type='text'>
</content>
</entry>
</feed>
