This commit is contained in:
Dmitry Zuikov 2024-09-11 12:29:04 +03:00
parent b78e80d19c
commit 6178b04310
2 changed files with 8 additions and 3 deletions

View File

@ -392,7 +392,7 @@ refchanExport dry = do
let box = makeSignedBox @'HBS2Basic @BS.ByteString pk sk (LBS.toStrict lbs)
warn $ "POST" <+> red "unencrypted!" <+> pretty (hashObject @HbSync (serialise box))
warn $ "POST" <+> red "unencrypted!" <+> pretty (length x) <+> pretty (hashObject @HbSync (serialise box))
unless dry do
r <- callRpcWaitMay @RpcRefChanPropose (TimeoutSec 1) rchanAPI (chan, box)
@ -464,9 +464,11 @@ refchanImport = do
w <- readTVarIO ttsmap <&> fromMaybe (exportedWeight i) . HM.lookup h
let item = i { exportedWeight = w }
unless (exportedWeight item == 0) do
if exportedWeight item /= 0 then do
notice $ "import" <+> pretty (exportedKey item) <+> pretty (exportedWeight item)
insertFixmeExported (localNonce i) item
insertFixmeExported (localNonce (href,i)) item
else do
warn "SKIP TX!"
atx <- readTVarIO accepts <&> fromMaybe mempty . HM.lookup h
insertScanned txh

View File

@ -439,6 +439,9 @@ instance LocalNonce FixmeExported where
HashRef $ hashObject @HbSync
$ serialise (exportedKey,exportedName,exportedValue)
instance LocalNonce (HashRef, FixmeExported) where
localNonce (h, e) = HashRef $ hashObject @HbSync
$ serialise (h, localNonce e)
data WithNonce a = WithNonce HashRef a