RPC Server #103
1 changed files with 34 additions and 9 deletions
|
@ -827,7 +827,6 @@ shieldTransparentNotes pool zebraHost zebraPort znet za bh = do
|
||||||
dRecvs
|
dRecvs
|
||||||
forM fNotes $ \trNotes -> do
|
forM fNotes $ \trNotes -> do
|
||||||
let noteTotal = getTotalAmount (trNotes, [], [])
|
let noteTotal = getTotalAmount (trNotes, [], [])
|
||||||
let fee = calculateTxFee (trNotes, [], []) 4
|
|
||||||
tSpends <-
|
tSpends <-
|
||||||
liftIO $
|
liftIO $
|
||||||
prepTSpends
|
prepTSpends
|
||||||
|
@ -839,27 +838,53 @@ shieldTransparentNotes pool zebraHost zebraPort znet za bh = do
|
||||||
let oRcvr =
|
let oRcvr =
|
||||||
fromJust $
|
fromJust $
|
||||||
o_rec =<< isValidUnifiedAddress (E.encodeUtf8 internalUA)
|
o_rec =<< isValidUnifiedAddress (E.encodeUtf8 internalUA)
|
||||||
let snote =
|
let dummy =
|
||||||
OutgoingNote
|
OutgoingNote
|
||||||
4
|
4
|
||||||
(getBytes $ getOrchSK $ zcashAccountOrchSpendKey $ entityVal acc)
|
(getBytes $ getOrchSK $ zcashAccountOrchSpendKey $ entityVal acc)
|
||||||
(getBytes oRcvr)
|
(getBytes oRcvr)
|
||||||
(fromIntegral $ noteTotal - fee)
|
(fromIntegral $ noteTotal - 5000)
|
||||||
""
|
""
|
||||||
True
|
True
|
||||||
let tx =
|
let feeResponse =
|
||||||
createTransaction
|
createTransaction
|
||||||
Nothing
|
Nothing
|
||||||
Nothing
|
Nothing
|
||||||
tSpends
|
tSpends
|
||||||
[]
|
[]
|
||||||
[]
|
[]
|
||||||
[snote]
|
[dummy]
|
||||||
znet
|
znet
|
||||||
(bh + 3)
|
bh
|
||||||
True
|
False
|
||||||
logDebugN $ T.pack $ show tx
|
case feeResponse of
|
||||||
return tx
|
Left e1 -> return $ Left Fee
|
||||||
|
Right fee -> do
|
||||||
|
let feeAmt =
|
||||||
|
fromIntegral
|
||||||
|
(runGet getInt64le $ LBS.fromStrict $ toBytes fee)
|
||||||
|
let snote =
|
||||||
|
OutgoingNote
|
||||||
|
4
|
||||||
|
(getBytes $
|
||||||
|
getOrchSK $ zcashAccountOrchSpendKey $ entityVal acc)
|
||||||
|
(getBytes oRcvr)
|
||||||
|
(fromIntegral $ noteTotal - feeAmt)
|
||||||
|
""
|
||||||
|
True
|
||||||
|
let tx =
|
||||||
|
createTransaction
|
||||||
|
Nothing
|
||||||
|
Nothing
|
||||||
|
tSpends
|
||||||
|
[]
|
||||||
|
[]
|
||||||
|
[snote]
|
||||||
|
znet
|
||||||
|
(bh + 3)
|
||||||
|
True
|
||||||
|
logDebugN $ T.pack $ show tx
|
||||||
|
return tx
|
||||||
where
|
where
|
||||||
getTotalAmount ::
|
getTotalAmount ::
|
||||||
( [Entity WalletTrNote]
|
( [Entity WalletTrNote]
|
||||||
|
|
Loading…
Reference in a new issue