CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 00:46:03 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=06b49ac40a8a3e0f79344664a08604d2aa19589008f34fe188ec3f3105173fb4a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%225lNUnpU0DHT3cjSo7R5SFYmRfuYjC-tK%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d293f71c204e3d-BLR
server.srs - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loop {
- let (socket, addr) = listener.accept().await.unwrap();
- println!("New connection from: {addr}");
- let mut framed_stream = Framed::new(socket, ServerCodec);
- let new_txs = new_txs.clone();
- let state = state.clone();
- let new_task = tokio::spawn(async move {
- while let Some(Ok(frame)) = framed_stream.next().await {
- match frame {
- TxFrame(txs) => {
- println!("New txs received");
- //todo: verify that txs are valid
- let mut new_txs = { new_txs.lock().unwrap().clone() };
- new_txs.extend(txs);
- },
- Mined(block) => {
- let mut state = state.lock().unwrap();
- if state.add_block_if_valid(block).is_ok() {
- println!("New block accepted");
- let mut new_txs = new_txs.lock().unwrap();
- new_txs.clear();
- //new_txs.retain(|item| !block_clone.txs.iter().any(|x| x == item));
- } else {
- println!("New block rejected");
- }
- },
- GetNewTxpool => {
- //println!("Tx pool requested");
- let new_txs = { new_txs.lock().unwrap().clone() };
- framed_stream.send(ServerFrame::NewTxPool(new_txs)).await;
- },
- GetVersion => {
- framed_stream.send(ServerFrame::Version(env!("CARGO_PKG_VERSION").to_string())).await;
- },
- GetLastHash => {
- println!("Last hash requested");
- let last_hash = {
- //change this later
- let blocks = state.lock().unwrap().blocks.clone();
- blocks.last().unwrap().get_hash()
- };
- framed_stream.send(ServerFrame::LastBlockHash(last_hash)).await;
- },
- GetBlockchain => {
- println!("Blockchain requested");
- let block_chain = { state.lock().unwrap().blocks.clone() };
- framed_stream.send(ServerFrame::BlockChain(block_chain)).await;
- }
- }
- }
- });
- //match
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
π Instant BTC Profit Method β
Working
JavaScript | 1 sec ago | 0.24 KB
-
ββ
Swapzone Glitch β
Working ββ L
JavaScript | 3 sec ago | 0.25 KB
-
π MAKE $2500 IN 15 MIN β
Working
JavaScript | 10 sec ago | 0.24 KB
-
β
Make $2500 in 20 minutesβββ 7
JavaScript | 12 sec ago | 0.25 KB
-
π΅ Make 3000$ in 20 minutes π΅
JavaScript | 19 sec ago | 0.24 KB
-
π Swapzone +37% glitch β 6
JavaScript | 21 sec ago | 0.25 KB
-
π Swapzone +37% glitch
JavaScript | 28 sec ago | 0.24 KB
-
ββ
Marketplace Glitch β
Working β
NEVER SEEN...
JavaScript | 35 sec ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand